Back

Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
2 views
by (2.3k points)

So I've been trying to build my image, but I keep getting this error:

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

It seems that I am getting an error because of this section of my docker file :

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

Can someone Help me out here ?

1 Answer

0 votes
by (6.9k points)

Well, the directory /var/www does not exist either and the issue is that mkdir command is recursive by default, i.e. mkdir assumes that the immediate parent directory already exists.

Try using this :

mkdir -p /var/www/app

Or what you can do is , you can try and install a package that makes a /var/www before itself.

Hope that helped :)


If you think you are weak in docker and need help from professional DevOps engineers who have immense knowledge in docker, docker training is the right course for you.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Sep 18, 2020 in Docker by Justin (7k points)

Browse Categories

...