Why are only some created directories showing up in the final running image. Here are my steps. It should be trivial:
Use this Dockerfile:
RUN mkdir -pv \
/var/www/html/blog && chown -R www-data:www-data /var/www/html/blog
Then build it with this command:
docker build -t stockmusic-blog:latest .
I see this output (truncated):
---> Running in 4c1a7a0b7ee3
mkdir: created directory '/var/www/html/blog'
mkdir: created directory '/var/www/html/blog/wp-content'
mkdir: created directory '/var/www/html/blog/wp-content/uploads'
mkdir: created directory '/var/www/html/blog/wp-content/uploads/pb_backupbuddy'
mkdir: created directory '/var/www/html/blog/wp-content/uploads/backupbuddy_temp'
mkdir: created directory '/var/www/html/blog/wp-content/uploads/backupbuddy_backups'
mkdir: created directory '/var/www/html/blog/wp-content/cache'
mkdir: created directory '/var/app'
mkdir: created directory '/var/app/current'
mkdir: created directory '/var/app/current/public'
Removing intermediate container 4c1a7a0b7ee3
Successfully built 51cf49fe0867
Successfully tagged stockmusic-blog:latest
The output shows the directories are being created.
Okay, lets run the container and see the newly created directories:
└─> docker run -d stockmusic-blog:latest
└─> docker exec -t -i dde6311 /bin/bash
root@dde6311c8997:/var/www/html# cd /var/app/current/public/
root@dde6311c8997:/var/app/current/public# cd /var/www/html/blog/wp-content
bash: cd: /var/www/html/blog/wp-content: No such file or directory
root@dde6311c8997:/var/www/html# cd /var/www/html/blog
bash: cd: /var/www/html/blog/: No such file or directory
So the directory
/var/app/current/public Was created successfully, but none of the other directories are there.
Why? What is going on here? I’m really pulling my hair out on this one. Thanks!