github.com/rumpl/bof@v23.0.0-rc.2+incompatible/client/container_update.go (about)

     1  package client // import "github.com/docker/docker/client"
     2  
     3  import (
     4  	"context"
     5  	"encoding/json"
     6  
     7  	"github.com/docker/docker/api/types/container"
     8  )
     9  
    10  // ContainerUpdate updates the resources of a container.
    11  func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) {
    12  	var response container.ContainerUpdateOKBody
    13  	serverResp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil)
    14  	defer ensureReaderClosed(serverResp)
    15  	if err != nil {
    16  		return response, err
    17  	}
    18  
    19  	err = json.NewDecoder(serverResp.body).Decode(&response)
    20  	return response, err
    21  }