containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
5.01k stars 477 forks source link

Overlay Volume Mounts not working #953

Open CoenraadS opened 4 months ago

CoenraadS commented 4 months ago

When a service has a volume with overlay mounting parameter, writes still are written to the host volume.

To Reproduce

services:
  app:
    image: docker.io/library/httpd
    ports:
      - "8080:80"
    volumes:
      - ./app:/app:O  # :O Parameter for overlay volume mount
    working_dir: /app
    command: touch out.txt

Expected behavior The file out.txt should be written to the overlay, not the host.

Actual behavior out.txt is written to host volume

Output

**Environment:**
 - OS:  WSL 
 - podman version: podman.exe version 5.0.2
 - podman compose version: Docker Compose version v2.24.0-birthday.10
Container Inspect ``` { "Id": "29723043dff498b6da3b8b176ea7e6b69a6ee1e265c0dddca7bb4c4879a3cede", "Created": "2024-05-27T22:49:01.319773889Z", "Path": "touch", "Args": [ "out.txt" ], "State": { "Status": "exited", "Running": false, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 0, "ExitCode": 0, "Error": "", "StartedAt": "2024-05-27T22:49:01.684147176Z", "FinishedAt": "2024-05-27T22:49:01.678160105Z" }, "Image": "sha256:356125da059505ee31a72f8a27fe5703c84886832b08ea565fa4a5ec4bfb722c", "ResolvConfPath": "/run/containers/storage/overlay-containers/29723043dff498b6da3b8b176ea7e6b69a6ee1e265c0dddca7bb4c4879a3cede/userdata/resolv.conf", "HostnamePath": "/run/containers/storage/overlay-containers/29723043dff498b6da3b8b176ea7e6b69a6ee1e265c0dddca7bb4c4879a3cede/userdata/hostname", "HostsPath": "/run/containers/storage/overlay-containers/29723043dff498b6da3b8b176ea7e6b69a6ee1e265c0dddca7bb4c4879a3cede/userdata/hosts", "LogPath": "", "Name": "/poc-app-1", "RestartCount": 0, "Driver": "overlay", "Platform": "linux", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "ExecIDs": [], "HostConfig": { "Binds": [ "/mnt/c/Users/coenraad.stijne/Downloads/poc/app:/app:rw,rprivate,rbind" ], "ContainerIDFile": "", "LogConfig": { "Type": "journald", "Config": null }, "NetworkMode": "bridge", "PortBindings": { "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "8080" } ] }, "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, "AutoRemove": false, "VolumeDriver": "", "VolumesFrom": null, "ConsoleSize": [ 0, 0 ], "CapAdd": [], "CapDrop": [], "CgroupnsMode": "", "Dns": [], "DnsOptions": [], "DnsSearch": [], "ExtraHosts": [], "GroupAdd": [], "IpcMode": "shareable", "Cgroup": "", "Links": null, "OomScoreAdj": 0, "PidMode": "private", "Privileged": false, "PublishAllPorts": false, "ReadonlyRootfs": false, "SecurityOpt": [], "UTSMode": "private", "UsernsMode": "", "ShmSize": 65536000, "Runtime": "oci", "Isolation": "", "CpuShares": 0, "Memory": 0, "NanoCpus": 0, "CgroupParent": "", "BlkioWeight": 0, "BlkioWeightDevice": null, "BlkioDeviceReadBps": null, "BlkioDeviceWriteBps": null, "BlkioDeviceReadIOps": null, "BlkioDeviceWriteIOps": null, "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpusetCpus": "", "CpusetMems": "", "Devices": [], "DeviceCgroupRules": null, "DeviceRequests": null, "MemoryReservation": 0, "MemorySwap": 0, "MemorySwappiness": 0, "OomKillDisable": false, "PidsLimit": 2048, "Ulimits": [ { "Name": "RLIMIT_NPROC", "Hard": 4194304, "Soft": 4194304 } ], "CpuCount": 0, "CpuPercent": 0, "IOMaximumIOps": 0, "IOMaximumBandwidth": 0, "MaskedPaths": null, "ReadonlyPaths": null }, "GraphDriver": { "Data": { "LowerDir": "/var/lib/containers/storage/overlay/a7d0e2a5c00427b1316753f23eff2b74de2bfe0322bf0a8e07c92a7c7dca0b4e/diff:/var/lib/containers/storage/overlay/5e8d8ba961097b7dc2cf24bd8fd3c6ff015966f5cbe40671f2c12364bef36a05/diff:/var/lib/containers/storage/overlay/a8301c7ce94a308b3adeb70892e3d27f4aa97c60dbe9987ef1ac80647e4713a5/diff:/var/lib/containers/storage/overlay/dd30c510fd540d1128564621bdac0bf99e68107baa7c64aa3d2a9cfa2355f31a/diff:/var/lib/containers/storage/overlay/3e71e9263a05d8842b80c3ad262d4ad9f2054b2538e93627cca8db8c884cc8ee/diff:/var/lib/containers/storage/overlay/5d4427064ecc46e3c2add169e9b5eafc7ed2be7861081ec925938ab628ac0e25/diff", "UpperDir": "/var/lib/containers/storage/overlay/30c9572ad8de828516d96eac95b62f19c24a24427596d4de3b3f4d829dc11d3d/diff", "WorkDir": "/var/lib/containers/storage/overlay/30c9572ad8de828516d96eac95b62f19c24a24427596d4de3b3f4d829dc11d3d/work" }, "Name": "overlay" }, "SizeRootFs": 0, "Mounts": [ { "Type": "bind", "Source": "/mnt/c/Users/coenraad.stijne/Downloads/poc/app", "Destination": "/app", "Mode": "", "RW": true, "Propagation": "rprivate" } ], "Config": { "Hostname": "29723043dff4", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "80/tcp": {} }, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "HTTPD_VERSION=2.4.59", "PATH=/usr/local/apache2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "container=podman", "HTTPD_SHA256=ec51501ec480284ff52f637258135d333230a7d229c3afa6f6c2f9040e321323", "HTTPD_PATCHES=", "HTTPD_PREFIX=/usr/local/apache2", "HOME=/root", "HOSTNAME=29723043dff4" ], "Cmd": [ "touch", "out.txt" ], "Image": "docker.io/library/httpd:latest", "Volumes": null, "WorkingDir": "/app", "Entrypoint": [], "OnBuild": null, "Labels": { "com.docker.compose.config-hash": "02ffa4491fcf5f467f1c9423a3f4b58fe1c0f604bf5325e7d0112e88fc310340", "com.docker.compose.container-number": "1", "com.docker.compose.depends_on": "", "com.docker.compose.image": "sha256:356125da059505ee31a72f8a27fe5703c84886832b08ea565fa4a5ec4bfb722c", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "poc", "com.docker.compose.project.config_files": "C:\\Users\\coenraad.stijne\\Downloads\\poc\\docker-compose.yml", "com.docker.compose.project.working_dir": "C:\\Users\\coenraad.stijne\\Downloads\\poc", "com.docker.compose.replace": "fc63a83ad215ac399fb97961507013e0fe88598d61c4e33114f90940605d1527", "com.docker.compose.service": "app", "com.docker.compose.version": "2.24.0" }, "StopSignal": "28", "StopTimeout": 10 }, "NetworkSettings": { "Bridge": "", "SandboxID": "", "SandboxKey": "", "Ports": { "80/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "8080" } ] }, "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "poc_default": { "IPAMConfig": null, "Links": null, "Aliases": [ "poc-app-1", "app", "29723043dff4" ], "MacAddress": "", "NetworkID": "poc_default", "EndpointID": "", "Gateway": "", "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "DriverOpts": null, "DNSNames": null } } } } ```
podman info ``` host: arch: amd64 buildahVersion: 1.35.3 cgroupControllers: - cpuset - cpu - io - memory - hugetlb - pids - rdma - misc cgroupManager: cgroupfs cgroupVersion: v2 conmon: package: conmon-2.1.10-1.fc40.x86_64 path: /usr/bin/conmon version: 'conmon version 2.1.10, commit: ' cpuUtilization: idlePercent: 99.1 systemPercent: 0.52 userPercent: 0.39 cpus: 4 databaseBackend: sqlite distribution: distribution: fedora variant: container version: "40" eventLogger: journald freeLocks: 2042 hostname: ir-n-coenraad idMappings: gidmap: null uidmap: null kernel: 5.15.146.1-microsoft-standard-WSL2 linkmode: dynamic logDriver: journald memFree: 5499510784 memTotal: 6218997760 networkBackend: netavark networkBackendInfo: backend: netavark dns: package: aardvark-dns-1.10.0-1.fc40.x86_64 path: /usr/libexec/podman/aardvark-dns version: aardvark-dns 1.10.0 package: netavark-1.10.3-3.fc40.x86_64 path: /usr/libexec/podman/netavark version: netavark 1.10.3 ociRuntime: name: crun package: crun-1.14.4-1.fc40.x86_64 path: /usr/bin/crun version: |- crun version 1.14.4 commit: a220ca661ce078f2c37b38c92e66cf66c012d9c1 rundir: /run/crun spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL os: linux pasta: executable: /usr/bin/pasta package: passt-0^20240510.g7288448-1.fc40.x86_64 version: | pasta 0^20240510.g7288448-1.fc40.x86_64 Copyright Red Hat GNU General Public License, version 2 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. remoteSocket: exists: true path: /run/podman/podman.sock security: apparmorEnabled: false capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT rootless: false seccompEnabled: true seccompProfilePath: /usr/share/containers/seccomp.json selinuxEnabled: false serviceIsRemote: true slirp4netns: executable: "" package: "" version: "" swapFree: 2147483648 swapTotal: 2147483648 uptime: 0h 4m 10.00s variant: "" plugins: authorization: null log: - k8s-file - none - passthrough - journald network: - bridge - macvlan - ipvlan volume: - local registries: search: - docker.io store: configFile: /usr/share/containers/storage.conf containerStore: number: 5 paused: 0 running: 0 stopped: 5 graphDriverName: overlay graphOptions: overlay.imagestore: /usr/lib/containers/storage overlay.mountopt: nodev,metacopy=on graphRoot: /var/lib/containers/storage graphRootAllocated: 1081101176832 graphRootUsed: 1734758400 graphStatus: Backing Filesystem: extfs Native Overlay Diff: "false" Supports d_type: "true" Supports shifting: "false" Supports volatile: "true" Using metacopy: "true" imageCopyTmpDir: /var/tmp imageStore: number: 7 runRoot: /run/containers/storage transientStore: false volumePath: /var/lib/containers/storage/volumes version: APIVersion: 5.0.2 Built: 1713312000 BuiltTime: Wed Apr 17 10:00:00 2024 GitCommit: "" GoVersion: go1.22.1 Os: linux OsArch: linux/amd64 Version: 5.0.2 ```