Merge pull request #16777 from Luap99/build-remote-volume

podman-remote build add --volume support
This commit is contained in:
OpenShift Merge Robot
2022-12-09 04:32:57 -05:00
committed by GitHub
6 changed files with 15 additions and 5 deletions

View File

@ -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")
}

View File

@ -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>

View File

@ -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),

View File

@ -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:

View File

@ -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 {

View File

@ -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" \