Docker Community Forums

Share and learn in the Docker community.

Building an Image from file error

build

(Mashkoor) #1

hi to all,

I am new to Docker world. First time I am trying to create an image with docker file it is giving the error message as bellow.

Below is the details of Docker file from which I am building the image.
Dockerfile

FROM ubuntu
MAINTAINER Admin Admin@localmail.com
RUN apt-get update
RUN apt-get upgrade -y
RUN apt install -y openssh-server vim
RUN mkdir /var/run/sshd
RUN echo ‘root:AbC-123#’ |chpasswd
RUN sed -i ‘s/#PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ssh/sshd_config
RUN sed ‘s@session\srequired\spam_loginuid.so@session optional pam_loginuid.so@g’ -i /etc/pam.d/sshd
ENV NOTVISIBLE “in Users profile”
RUN echo “export VISIBLE=now” >> /ect/profile
EXPOSE 22

#to enable the any service to start at containers startup

CMD ["/usr/sbin/sshd", “-D”]

Bellow is the output of build command.

redmath@RM-UBTD-L01:~/Docker$ docker build -t eg_sshd .
Sending build context to Docker daemon 2.56kB
Step 1/13 : FROM ubuntu
—> 93fd78260bd1
Step 2/13 : MAINTAINER AdminAdmin@localmail.com
—> Using cache
—> 0e00792e67aa
Step 3/13 : RUN apt-get update
—> Using cache
—> cc2b0b244eaa
Step 4/13 : RUN apt-get upgrade -y
—> Using cache
—> 8e05fb3577fb
Step 5/13 : RUN apt install -y openssh-server vim
—> Using cache
—> 39f90ee3a864
Step 6/13 : RUN mkdir /var/run/sshd
—> Using cache
—> 087ae010934b
Step 7/13 : RUN echo ‘root:AbC-123#’ |chpasswd
—> Using cache
—> 40ba2815a3c7
Step 8/13 : RUN sed -i ‘s/#PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ssh/sshd_config
—> Using cache
—> 7544a2347a07
Step 9/13 : RUN sed ‘s@session\srequired\spam_loginuid.so@session optional pam_loginuid.so@g’ -i /etc/pam.d/sshd
—> Using cache
—> 87e78069af30
Step 10/13 : ENV NOTVISIBLE “in Users profile”
—> Using cache
—> f7087994e888
Step 11/13 : RUN sudo echo “export VISIBLE=now” >> /ect/profile
—> Running in 9fd5c4673f9d
/bin/sh: 1: cannot create /ect/profile: Directory nonexistent
/bin/sh: 1: sudo: not found
The command ‘/bin/sh -c sudo echo “export VISIBLE=now” >> /ect/profile’ returned a non-zero code: 127

that’s the output of command. Google is not helping in this. Any help would be highly appreciable.
Thanks in Advance.