Skip to content
Kamal Mustafa edited this page Oct 4, 2017 · 3 revisions

We're docker, ok just kidding. But lately, we talked a lot about docker in the group.

Override entrypoint

docker run -it --entrypoint=/bin/bash userorg/imagename:tagname

Problem it solved - If the image is using ENTRYPOINT instead of CMD, the command that you specify at the end of your docker command will be passed as an argument to the ENTRYPOINT command, which maybe not what you want. Consider a Dockerfile with ENTRYPOINT:-

ENTRYPOINT ["/usr/bin/drone"]

When you docker run -it drone /bin/bash, you'll output like "No help for /bin/bash", which quite confusing at first. It turn out what get executed inside the container is:-

/us/bin/drone /bin/bash

For more info on CMD vs ENTRYPOINT, you can read https://www.ctl.io/developers/blog/post/dockerfile-entrypoint-vs-cmd/.

Extract full fs of a given docker image into tmp/fs

mkdir tmp
cd tmp
docker save alpine | tar xf -
cd ..
mkdir fs
cd fs
find ../tmp *.tar -exec tar xf {} \;
Clone this wiki locally