Docker: docker-compose in swarm mode give ro filesystem

I still don’t know why this happens, I looked again and my best guess is (still) that there is a specific bug in docker swarm that makes it not observe the --data-root argument we use to launch dockerd.

I was able to work-around the issue by removing --data-root argument from the command line we launch dockerd with, and adding a layout on /var/lib/docker to the snap:

layout:
  /etc/docker:
    bind: $SNAP_DATA/etc/docker
  /var/lib/docker:
    bind: $SNAP_COMMON/var-lib-docker

I did not do much more testing of the docker snap with this, perhaps that doesn’t work for other reasons but it at least works to run some basic containers and avoids this problem.

@tianon, WDYT of the proposed patch above ? It seems to fix a long standing bug with docker swarm with the docker snap

1 Like