mirror of
https://github.com/containers/podman.git
synced 2025-08-14 11:01:35 +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_wait.go
generated
vendored
Normal file
41
vendor/github.com/fsouza/go-dockerclient/container_wait.go
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
package docker
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// WaitContainer blocks until the given container stops, return the exit code
|
||||
// of the container status.
|
||||
//
|
||||
// See https://goo.gl/4AGweZ for more details.
|
||||
func (c *Client) WaitContainer(id string) (int, error) {
|
||||
return c.waitContainer(id, doOptions{})
|
||||
}
|
||||
|
||||
// WaitContainerWithContext blocks until the given container stops, return the exit code
|
||||
// of the container status. The context object can be used to cancel the
|
||||
// inspect request.
|
||||
//
|
||||
// See https://goo.gl/4AGweZ for more details.
|
||||
//nolint:golint
|
||||
func (c *Client) WaitContainerWithContext(id string, ctx context.Context) (int, error) {
|
||||
return c.waitContainer(id, doOptions{context: ctx})
|
||||
}
|
||||
|
||||
func (c *Client) waitContainer(id string, opts doOptions) (int, error) {
|
||||
resp, err := c.do(http.MethodPost, "/containers/"+id+"/wait", opts)
|
||||
if err != nil {
|
||||
if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
|
||||
return 0, &NoSuchContainer{ID: id}
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
var r struct{ StatusCode int }
|
||||
if err := json.NewDecoder(resp.Body).Decode(&r); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return r.StatusCode, nil
|
||||
}
|
Reference in New Issue
Block a user