mirror of
https://github.com/containers/podman.git
synced 2025-06-07 07:24:01 +08:00
new "image" mount type
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>
This commit is contained in:
41
vendor/github.com/fsouza/go-dockerclient/container_stop.go
generated
vendored
Normal file
41
vendor/github.com/fsouza/go-dockerclient/container_stop.go
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
package docker
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// StopContainer stops a container, killing it after the given timeout (in
|
||||
// seconds).
|
||||
//
|
||||
// See https://goo.gl/R9dZcV for more details.
|
||||
func (c *Client) StopContainer(id string, timeout uint) error {
|
||||
return c.stopContainer(id, timeout, doOptions{})
|
||||
}
|
||||
|
||||
// StopContainerWithContext stops a container, killing it after the given
|
||||
// timeout (in seconds). The context can be used to cancel the stop
|
||||
// container request.
|
||||
//
|
||||
// See https://goo.gl/R9dZcV for more details.
|
||||
//nolint:golint
|
||||
func (c *Client) StopContainerWithContext(id string, timeout uint, ctx context.Context) error {
|
||||
return c.stopContainer(id, timeout, doOptions{context: ctx})
|
||||
}
|
||||
|
||||
func (c *Client) stopContainer(id string, timeout uint, opts doOptions) error {
|
||||
path := fmt.Sprintf("/containers/%s/stop?t=%d", id, timeout)
|
||||
resp, err := c.do(http.MethodPost, path, opts)
|
||||
if err != nil {
|
||||
if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
|
||||
return &NoSuchContainer{ID: id}
|
||||
}
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode == http.StatusNotModified {
|
||||
return &ContainerNotRunning{ID: id}
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user