Closed yurishkuro closed 6 years ago
I've been meaning to revamp our Docker images, applying some of the good practices shown during a presentation I watched a couple of months ago: https://de.slideshare.net/QAware/docker-und-kubernetes-patters-antipatterns (slide 15, it's in German but shouldn't be difficult to deduce what the good practices are).
Currently Dockerfiles are using a mix of ENTRYPOINT and CMD. If we change the ENTRYPOINT to always point to the executable, and CMD to point to the default arguments (like
all
for hotrod image), then the containers can be run as executables with additional parameters overriding the CMD, but not overriding ENTRYPOINT.E.g. hotrod's Dockerfile should have
while all other binaries should have just the ENTRYPOINT pointing to the binary.
The main benefit is that when users run the image and pass additional arguments, they don't need to know the name of the binary inside the image.