mirror of
https://github.com/containers/podman.git
synced 2025-06-26 04:46:57 +08:00
Merge pull request #18458 from Luap99/docker-dup-volume
compat container create: match duplicate mounts correctly
This commit is contained in:
@ -483,7 +483,7 @@ func cliOpts(cc handlers.CreateContainerConfig, rtc *config.Config) (*entities.C
|
|||||||
// This also handles volumes duplicated between cc.HostConfig.Mounts and
|
// This also handles volumes duplicated between cc.HostConfig.Mounts and
|
||||||
// cc.Volumes, as seen in compose v2.0.
|
// cc.Volumes, as seen in compose v2.0.
|
||||||
for vol := range cc.Volumes {
|
for vol := range cc.Volumes {
|
||||||
if _, ok := volDestinations[filepath.Clean(vol)]; ok {
|
if _, ok := volDestinations[vol]; ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
cliOpts.Volume = append(cliOpts.Volume, vol)
|
cliOpts.Volume = append(cliOpts.Volume, vol)
|
||||||
|
@ -357,6 +357,15 @@ t GET containers/$cid/json 200 \
|
|||||||
|
|
||||||
t DELETE containers/$cid?v=true 204
|
t DELETE containers/$cid?v=true 204
|
||||||
|
|
||||||
|
# Test Volumes with bind mount, for some reason docker-py sets this #18454
|
||||||
|
t POST containers/create Image=$IMAGE Volumes='{"/test/":{}}' HostConfig='{"Binds":["/tmp:/test/:ro"]}' 201 \
|
||||||
|
.Id~[0-9a-f]\\{64\\}
|
||||||
|
cid=$(jq -r '.Id' <<<"$output")
|
||||||
|
t GET containers/$cid/json 200 \
|
||||||
|
.Mounts[0].Destination="/test/"
|
||||||
|
|
||||||
|
t DELETE containers/$cid?v=true 204
|
||||||
|
|
||||||
# test port mapping
|
# test port mapping
|
||||||
podman run -d --rm --name bar -p 8080:9090 $IMAGE top
|
podman run -d --rm --name bar -p 8080:9090 $IMAGE top
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user