Home > other >  Through dockerfile build image problem!!
Through dockerfile build image problem!!

Time:09-17

I am a rookie, today want to use dockerfile build a FTP service container, have some problems, really don't know what's going on, I ask the player in the BBS, specific problems are as follows:
Dockerfile:
 
The FROM centos: 7
The ADD proftpd - 1.3.5 b.t ar. Gz/opt
COPY proftpd. Conf/opt
The RUN yum install.net y - tools \
& & Useradd -s/sbin/nologin proftp \
& & Echo "proftp:123.com" | chpasswd \
& & Yum install - y GCC make \
& & CD/opt/proftpd - 1.3.5 b \
& & ./configure -- prefix=/usr/local/proftpd \
& & Make \
& & Make install \
& & Mv/usr/local/proftpd/etc/proftpd. Conf/usr/local/proftpd/etc/proftpd. Conf. Bak \
& & Cp/opt/proftpd. Conf/usr/local/proftpd/etc/
EXPOSE the 21st
CMD/usr/local/proftpd/sbin/proftpd


Construction:
 
Docker build -t proftpd: v1.

The last tip success!
Then start the container
 
[root @ localhost dockerfile] # docker run - itd - p as proftpd: v1
4 a3d876a92f2a73dc20ba45764b79d0230bd98e00eb2b1155f73eb570c740d01
[root @ localhost dockerfile] # docker ps - a
The CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4 a3d876a92f2 proftpd: v1 "/bin/sh -c/usr/l... "Seven seconds line Exited (0) 6 seconds line wonderful_perlman

Port mapping failed, looked really service not up into the container is dockerfile CMD command inside write wrong, please give advice or comments!

CodePudding user response:


Their top, looking forward to master!

CodePudding user response:

Docker inspect containerID
Go to the LogPath look at the log

CodePudding user response:

Docker run - itd - p as proftpd: v1
Grammar is no problem, maybe your port value is too small, suggest to larger than 30000:30000 is 21 port being used

CodePudding user response:

Because execute the/usr/local/proftpd/sbin/proftpd terminal after exit, thus the container also withdrew,
So I need to:
CMD/usr/local/proftpd/sbin/proftpd & amp; & Top
So your command blocks which container will not quit,
  • Related