Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mkdir is not executing in Dockerfile/build

There is already a question, with answer, under a similar title, but the title isn't really outlining the true question. mkdir is in fact executing for the other question/thread. It is just failing...

Whereas I've:

RUN mkdir -p /home/developer And I get: Step 18 : RUN MKDIR Unknown instruction: RUN MKDIR

That is ACTUALLY not executing.

Here is the Docker file from line 1. All of these steps succeed, until mkdir.

FROM ubuntu:14.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y purge php.*
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y wget
RUN apt-get install -y build-essential
RUN wget http://xmlsoft.org/sources/libxml2-2.8.0.tar.gz
RUN tar -xvf libxml2-2.8.0.tar.gz
WORKDIR libxml2-2.8.0
RUN ./configure && make && make install
RUN apt-get install -y make
# build php
RUN wget http://museum.php.net/php5/php-5.4.0.tar.bz2
RUN tar -xvf php-5.4.0.tar.bz2
WORKDIR php-5.4.0
RUN ./configure && make
RUN make install
# Replace 1000 with your user / group id
RUN export uid=1000 gid=1000
# −p, −−parents -> no error if existing, make parent directories as needed
RUN mkdir -p /home/developer
like image 519
Neil Gaetano Lindberg Avatar asked Jan 13 '16 19:01

Neil Gaetano Lindberg


1 Answers

There's an interesting character between RUN and mkdir in your Dockerfile. Replacing it with a space makes your Dockerfile build.

docker build output with yours:

Sending build context to Docker daemon 2.048 kB
Step 1 : FROM ubuntu:14.04
 ---> c4bea91afef3
Step 2 : RUN MKDIR
Unknown instruction: RUN MKDIR

docker build output with fixed:

Sending build context to Docker daemon 2.048 kB
Step 1 : FROM ubuntu:14.04
 ---> c4bea91afef3
Step 2 : RUN mkdir -p /home/developer
 ---> Using cache
 ---> 1ac57f7c9ccd
Successfully built 1ac57f7c9ccd
like image 94
Kynan Avatar answered Nov 29 '22 08:11

Kynan