This is an error message I get when building a Docker image:
Step 18 : RUN mkdir /var/www/app && chown luqo33:www-data /var/www/app
---> Running in 7b5854406120 mkdir: cannot create directory '/var/www/app': No such file or directory
This is a fragment of Dockerfile that causes the error:
FROM ubuntu:14.04
RUN groupadd -r luqo33 && useradd -r -g luqo33 luqo33
<installing nginx, fpm, php and a couple of other things>
RUN mkdir /var/www/app && chown luqo33:www-data /var/www/app
VOLUME /var/www/app
WORKDIR /var/www/app
mkdir: cannot create directory '/var/www/app': No such file or directory
sound so nonsensical - of course there is no such directory. I want to create it. What is wrong here?
The problem is that
/var/www
doesn't exist either, andmkdir
isn't recursive by default -- it expects the immediate parent directory to exist.Use:
...or install a package that creates a
/var/www
prior to reaching this point in your Dockerfile.