The docker documentation says that you can build this minimal image:
FROM scratch
ADD hello /
CMD ["/hello"]
Presumably the way this works is that the CMD
step is using the default shell (that is, bin/sh
, per https://stackoverflow.com/a/21564990/10900852) to run the hello
executable.
But if SCRATCH is really entirely empty, where is bin/sh
coming from? Why does my image contain a shell?