docker / cli

The Docker CLI
Apache License 2.0
4.85k stars 1.91k forks source link

Error response from daemon: invalid mount config (introduced with 27.3.0) #5463

Closed stephanboersma closed 4 hours ago

stephanboersma commented 4 hours ago

Description

Hi,

It seems that a breaking change has been introduced with Docker version 27.3.0. I have Raspberry Pi's running with a Portainer edge agent and everything was working fine until updating Docker to v27.3.0.

docker-compose.yml

services:
  agent:
    container_name: agent
    image: portainer/agent:2.21.1
    restart: always
    environment:
      EDGE: 1
      EDGE_ID: ****
      EDGE_KEY: ****
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes

Error message:

Error response from daemon: invalid mount config: must use either propagation mode "rslave" or "rshared" when mount source is within the daemon root, daemon root: "/var/lib/docker", bind mount source: "/var/lib/docker/volumes", propagation: "rprivate"

Do I need to update my configuration or is this indeed a bug? If I need to specify propagation mode, can you advise me as to which one I must use?

Thanks!

BR, Stephan

Reproduce

  1. Create docker-compose.yml
  2. run docker compose up -d
  3. Observe error

Expected behavior

Create agent container successfully

docker version

Client: Docker Engine - Community
 Version:           27.3.0
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        e85edf8
 Built:             Thu Sep 19 14:26:29 2024
 OS/Arch:           linux/arm
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.3.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       41ca978
  Built:            Thu Sep 19 14:26:29 2024
  OS/Arch:          linux/arm
  Experimental:     false
 containerd:
  Version:          1.7.22
  GitCommit:        7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc:
  Version:          1.1.14
  GitCommit:        v1.1.14-0-g2c9f560
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    27.3.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.17.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.6
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: 27.3.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc version: v1.1.14-0-g2c9f560
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.6.51-v8+
 Operating System: Raspbian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 3.894GiB
 Name: raspberrypi
 ID: e11c4ed7-0b1f-429d-b30c-1b47fb00c7c6
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Additional Info

Running on Raspberry Pi 5 with Standard OS.

thaJeztah commented 4 hours ago

Thanks for reporting; this looks to be a duplicate of;

With a fix n;

Docker compose has published a new release, but it's not yet published as deb/rpm package on download.docker.com. In the meantime you can downgrade, and pin the docker-compose-plugin package to an older version.

I'll close this ticket as duplicate of https://github.com/docker/compose/issues/12139 and because it's not a bug in this repository, but feel free to continue the conversation.

stephanboersma commented 4 hours ago

Thanks, downgrading docker-compose-plugin solved it.

sudo apt-get purge docker-compose-plugin
sudo apt-get install docker-compose-plugin=2.29.2-1~raspbian.12~bookworm