Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mkdir: cannot create directory '/ffa_app': Permission denied

I am trying to create a Dockerfile for an app which I want to run inside the docker. I am running the app using the command activator run. and this command is inside the file structure xyz\Desktop\ffa_predix\activator-1.2.10. So, I have gone inside the file and put my Dockerfile there with the following content.

FROM jboss/base-jdk:7

RUN mkdir -p /ffa_app

COPY . /ffa_app

WORKDIR /ffa_app

CMD ["activator" , "run"]

EXPOSE 9000

But after going to the second line it's giving me the error:

mkdir: cannot create directory '/ffa_app': Permission denied.

like image 963
sd_30 Avatar asked Mar 07 '18 13:03

sd_30


1 Answers

The user set by the base image is jboss, so you have 2 options:

  • create and work in the user's home folder mkdir -p ~/ffa_app
  • set USER root at the top of your Dockerfile, after the FROM statement

Needless to say, I'd recommend sticking to a user with lower privileges.

like image 121
odino Avatar answered Oct 23 '22 18:10

odino