mirror of https://github.com/containers/podman.git
podman-remote build add --volume support
Just like podman-remote run users should still be able to set volumes, of course the source must be on the server machine but this is already the case for podman machine for example. Fixes #16694 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
6e2e9ab227
commit
9f6cf50d52
|
@ -189,7 +189,6 @@ func buildFlags(cmd *cobra.Command) {
|
|||
_ = flags.MarkHidden("signature-policy")
|
||||
_ = flags.MarkHidden("tls-verify")
|
||||
_ = flags.MarkHidden("compress")
|
||||
_ = flags.MarkHidden("volume")
|
||||
_ = flags.MarkHidden("output")
|
||||
_ = flags.MarkHidden("logsplit")
|
||||
}
|
||||
|
|
|
@ -767,8 +767,7 @@ using the architecture variant of the build host.
|
|||
|
||||
Create a bind mount. Specifying the `-v /HOST-DIR:/CONTAINER-DIR` option, Podman
|
||||
bind mounts `/HOST-DIR` from the host to `/CONTAINER-DIR` in the Podman
|
||||
container. (This option is not available with the remote Podman client,
|
||||
including Mac and Windows (excluding WSL2) machines)
|
||||
container.
|
||||
|
||||
The `OPTIONS` are a comma-separated list and can be: <sup>[[1]](#Footnote1)</sup>
|
||||
|
||||
|
|
|
@ -138,6 +138,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
|||
Timestamp int64 `schema:"timestamp"`
|
||||
Ulimits string `schema:"ulimits"`
|
||||
UnsetEnvs []string `schema:"unsetenv"`
|
||||
Volumes []string `schema:"volume"`
|
||||
}{
|
||||
Dockerfile: "Dockerfile",
|
||||
IdentityLabel: true,
|
||||
|
@ -670,6 +671,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
|||
ShmSize: strconv.Itoa(query.ShmSize),
|
||||
Ulimit: ulimits,
|
||||
Secrets: secrets,
|
||||
Volumes: query.Volumes,
|
||||
},
|
||||
Compression: compression,
|
||||
ConfigureNetwork: parseNetworkConfigurationPolicy(query.ConfigureNetwork),
|
||||
|
|
|
@ -1604,6 +1604,12 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
|
|||
// type: array
|
||||
// items:
|
||||
// type: string
|
||||
// - in: query
|
||||
// name: volume
|
||||
// description: Extra volumes that should be mounted in the build container.
|
||||
// type: array
|
||||
// items:
|
||||
// type: string
|
||||
// produces:
|
||||
// - application/json
|
||||
// responses:
|
||||
|
|
|
@ -290,6 +290,11 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
|
|||
params.Add("platform", platform)
|
||||
}
|
||||
}
|
||||
|
||||
for _, volume := range options.CommonBuildOpts.Volumes {
|
||||
params.Add("volume", volume)
|
||||
}
|
||||
|
||||
var err error
|
||||
var contextDir string
|
||||
if contextDir, err = filepath.EvalSymlinks(options.ContextDirectory); err == nil {
|
||||
|
|
|
@ -196,8 +196,7 @@ skip_if_remote "secret files not implemented under podman-remote" \
|
|||
"bud with containerfile env secret" \
|
||||
"bud with containerfile env secret priority"
|
||||
|
||||
skip_if_remote "volumes don't work with podman-remote" \
|
||||
"buildah bud --volume" \
|
||||
skip_if_remote "--signature-policy does not work with podman-remote" \
|
||||
"buildah-bud-policy"
|
||||
|
||||
skip_if_remote "--build-context option not implemented in podman-remote" \
|
||||
|
|
Loading…
Reference in New Issue