Docker mount order out of sequence and not letting me mount my directory Docker mount order out of sequence and not letting me mount my directory docker docker

Docker mount order out of sequence and not letting me mount my directory


First of all, you know that you can create two kind of volumes (let's ignore for this explanation tmpfs):

  • bind-type volume
  • volume-type volume
    • named volumes.
    • unnamed volumes.

When you create a bind-type, it's done an association between two directories or files.

When you create a volume-type, internally, it's done also a bind between /var/lib/docker/volumes//_data and destination. can be a string given by you (named volume) or a string like yours: d0a4f5ad342db0db782b... (unnamed volume)

So, you've created two bind-volumes from your local directory in host ./wp-contend furthermore a bind volume for uploads.ini file. Everything is ok.

The point is that you've inherit an unnamed volume from image: wordpress:latest.

If you had Dockerfile which was used to generate wordpress:latest, you would see a line like:

VOLUME [/var/www/html]

So, it's generated an unnamed volume in /var/lib/docker/volumes/d0a4f5ad342db0db782b41dd676aa0e58a324b5e7db1e56086bca5550a9ffdc3/_dataThat is done to avoid lose all generated information if container exits. Is a way to keep consistency of the data.So, if originally you had a single file your_file.txt in your ./wp-content, after wordpress starts, wordpress creates in wp-content the following dirs/files if don't exist: - index.php - plugins/ - themes/You should have the same information in your ./wp-content that you had before docker-compose -d up plus these generated-by-wordpress file and dirs, because you're mounting a bind volume in a subfolder over an already-mounted volume from wordpress image.