I'm pretty new to Docker and I'm trying to Dockerize a particular tool that is difficult to run on different platforms. For some reason the ENTRYPOINT and CMD commands are not working as I would expect.
What is baffling me is that when I run a script from inside the container, the script works, but when I run what I think is the exact same thing passing in runtime arguments, I get a completely different response from the script. I would expect them to be the same.
Here is my Dockerfile
FROM ubuntu:latest
RUN apt-get -y update
RUN apt-get -y install build-essential flex bison
COPY . /unicornscan
WORKDIR /unicornscan
RUN patch src/unilib/tsc.c patches/unicornscan-0.4.7-gcc5.patch
RUN ./configure CFLAGS=-D_GNU_SOURCE --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-bundled-ltdl
RUN make
RUN make install
ENTRYPOINT ["/usr/bin/unicornscan"]
CMD []
When I remove the entrypoint and cmd from the dockerfile and then run:
docker run -it test/image:1.0 sh
I am in the container. I then run:
/bin/sh -c "unicornscan -I -msf 22.22.22.22:a"
It starts telling me which ports are open on IP 22.22.22.22, which is what this tool is supposed to do.
Now, I add the entrypoint and cmd command back, rebuild, and then I run
docker run test/image:1.0 -I -msf 22.22.22.22:a
Now I get this output from the tool:
Send exiting ack, parent died?: system error No such file or directory
Every time I repeat this process the same thing happens, so my quesiton is, why? What is the difference between the two commands. I was under the impression that they were exactly the same.