mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 18:08:51 +08:00 
			
		
		
		
	 65a618886e
			
		
	
	65a618886e
	
	
	
		
			
			Add a new "image" mount type to `--mount`. The source of the mount is the name or ID of an image. The destination is the path inside the container. Image mounts further support an optional `rw,readwrite` parameter which if set to "true" will yield the mount writable inside the container. Note that no changes are propagated to the image mount on the host (which in any case is read only). Mounts are overlay mounts. To support read-only overlay mounts, vendor a non-release version of Buildah. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package docker
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"fmt"
 | |
| 	"net/http"
 | |
| )
 | |
| 
 | |
| // UpdateContainerOptions specify parameters to the UpdateContainer function.
 | |
| //
 | |
| // See https://goo.gl/Y6fXUy for more details.
 | |
| type UpdateContainerOptions struct {
 | |
| 	BlkioWeight        int           `json:"BlkioWeight"`
 | |
| 	CPUShares          int           `json:"CpuShares"`
 | |
| 	CPUPeriod          int           `json:"CpuPeriod"`
 | |
| 	CPURealtimePeriod  int64         `json:"CpuRealtimePeriod"`
 | |
| 	CPURealtimeRuntime int64         `json:"CpuRealtimeRuntime"`
 | |
| 	CPUQuota           int           `json:"CpuQuota"`
 | |
| 	CpusetCpus         string        `json:"CpusetCpus"`
 | |
| 	CpusetMems         string        `json:"CpusetMems"`
 | |
| 	Memory             int           `json:"Memory"`
 | |
| 	MemorySwap         int           `json:"MemorySwap"`
 | |
| 	MemoryReservation  int           `json:"MemoryReservation"`
 | |
| 	KernelMemory       int           `json:"KernelMemory"`
 | |
| 	RestartPolicy      RestartPolicy `json:"RestartPolicy,omitempty"`
 | |
| 	Context            context.Context
 | |
| }
 | |
| 
 | |
| // UpdateContainer updates the container at ID with the options
 | |
| //
 | |
| // See https://goo.gl/Y6fXUy for more details.
 | |
| func (c *Client) UpdateContainer(id string, opts UpdateContainerOptions) error {
 | |
| 	resp, err := c.do(http.MethodPost, fmt.Sprintf("/containers/"+id+"/update"), doOptions{
 | |
| 		data:      opts,
 | |
| 		forceJSON: true,
 | |
| 		context:   opts.Context,
 | |
| 	})
 | |
| 	if err != nil {
 | |
| 		return err
 | |
| 	}
 | |
| 	defer resp.Body.Close()
 | |
| 	return nil
 | |
| }
 |