Search code examples
bashdockerdockerfiledocker-entrypoint

Change ENTRYPOINT to container after building


I have a Dockerfile, which ends with:

ENTRYPOINT ["/bin/bash", "/usr/local/cdt-tests/run-tests.sh"]

After building this container, I want to run it, but instead of executing this bash script (run-tests.sh), I want to open up a terminal window inside the container to inspect the filesystem.

If there were no ENTRYPOINT line, I could do this:

docker build -t x .
docker run -it x /bin/bash

and I could examine the container's files.

However, since there is an ENTRYPOINT, then that script will run and I cannot examine the container's files.

Is there anything I can do to get into the container to snoop around?


Solution

  • docker run has an --entrypoint option