Here is my Dockerfile:
# Pull base image (Ubuntu) FROM dockerfile/python # Install socat RUN \ cd /opt && \ wget http://www.dest-unreach.org/socat/download/socat-1.7.2.4.tar.gz && \ tar xvzf socat-1.7.2.4.tar.gz && \ rm -f socat-1.7.2.4.tar.gz && \ cd socat-1.7.2.4 && \ ./configure && \ make && \ make install RUN \ start-stop-daemon --quiet --oknodo --start --pidfile /run/my.pid --background --make-pidfile \ --exec /opt/socat-1.7.2.4/socat PTY,link=/dev/ttyMY,echo=0,raw,unlink-close=0 \ TCP-LISTEN:9334,reuseaddr,fork # Define working directory. WORKDIR /data # Define default command. CMD ["bash"] I build an image from this Dockerfile and run it like this:
docker run -d -t -i myaccount/socat_test After this I login into the container and check if socat daemon is running. But it is not. I just started playing around with docker. Am I misunderstanding the concept of Dockerfile? I would expect docker to run the socat command when the container starts.