Skip to content

Can't create directories in the wp-content/ #534

@taraspos

Description

@taraspos

Here in Dockerfile https://github.com/docker-library/wordpress/blob/master/php7.4/fpm/Dockerfile#L88 directories are being pre-created, to set permissions on the folders for future mounts.

I wanted to add one more folder cache. But it was mysteriously gone from the container.

For example image like:

FROM wordpress:5.5.1-php7.4-fpm 
RUN mkdir /var/www/html/wp-content/cache/ && ls -al /var/www/html/wp-content/
RUN ls -al /var/www/html/wp-content/

Resulted in the following build log:

Step 1/3 : FROM wordpress:5.5.1-php7.4-fpm
 ---> 58a200fd0768
Step 2/3 : RUN mkdir /var/www/html/wp-content/cache/ && ls -al /var/www/html/wp-content/
 ---> Running in 68905758cdcf
total 20
drwxrwxrwx 5 www-data www-data 4096 Oct  8 13:18 .
drwxrwxrwx 3 www-data www-data 4096 Oct  8 13:18 ..
drwxr-xr-x 2 root     root     4096 Oct  8 13:18 cache
drwxrwxrwx 2 www-data www-data 4096 Sep 11 09:12 plugins
drwxrwxrwx 2 www-data www-data 4096 Sep 11 09:12 themes
Removing intermediate container 68905758cdcf
 ---> a1e985c4ad25
Step 3/3 : RUN ls -al /var/www/html/wp-content/
 ---> Running in 4ab957561104
total 16
drwxrwxrwx 4 www-data www-data 4096 Oct  8 13:18 .
drwxrwxrwx 3 www-data www-data 4096 Oct  8 13:18 ..
drwxrwxrwx 2 www-data www-data 4096 Sep 11 09:12 plugins
drwxrwxrwx 2 www-data www-data 4096 Sep 11 09:12 themes
Removing intermediate container 4ab957561104
 ---> a22fb6ca6c36
Successfully built a22fb6ca6c36

You can see, that on the step 2 directory cache is present, but on step 3 it is missing.
Apparently, this is a known bug moby/moby#3639.

Just wanted to leave this here for other people, or maybe we can come upon some better approach to pre-create some directories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions