Docker Community Forums

Share and learn in the Docker community.

Docker file giving error

docker

(Rahul Bansal) #1
FROM ubuntu

RUN "apt-get update && apt-get install -y moreutils"

CMD ["/bin/bash","-i"]

I created the above file and named it Dockerfile

To build the image,

sudo docker build -t test .

Sending build context to Docker daemon  2.048kB
Step 1/4 : FROM ubuntu
 ---> 94e814e2efa8
Step 2/4 : RUN "apt-get update && apt-get install -y moreutils"
 ---> Running in d4938a166310
/bin/sh: 1: apt-get update && apt-get install -y moreutils: not found
The command '/bin/sh -c "apt-get update && apt-get install -y moreutils"' returned a non-zero code: 127

I don’t see a problem, do you??


(Rahul Bansal) #2

Got it,

Removing " around parameter of RUN directive ran the script

but I don’t know why it didn’t build with " around


(Ove "Lime" Lindström) #3

It doesn’t build with the citation marks because you do not use citation marks when you send a command to bash.