Reputation: 86297
How do you shell into this image?
https://hub.docker.com/r/alpine/git
I tried:
docker pull alpine/git
docker run -it --rm alpine/git /bin/sh
but get
git: '/bin/sh' is not a git command. See 'git --help'.
Upvotes: 2
Views: 4284
Reputation: 461
The solution provided by @chepner is excellent:
docker run -it --rm --entrypoint /bin/sh alpine/git
But there is another way to do it:
docker run -it --rm --entrypoint '' alpine/git sh
This way you eliminate the entrypoint (/usr/bin/git) and run sh
directly. In the end, the command executed is ENTRYPOINT + CMD, so these are the same:
So it's up to you to choose which one is more convenient.
Upvotes: 0
Reputation: 531878
You have to override the entry point (which is git
). Otherwise, command line arguments are interpreted as arguments to git
.
docker run -it --rm --entrypoint /bin/sh alpine/git
Upvotes: 12