2023-02-16
Because I can’t make a statically linked binary, I will stick with an alpine container for now. Post on stackoverflow: https://stackoverflow.com/questions/75459376/statically-link-devmapper-when-using-cgo
About ENTRYPOINT vs CMD in a Dockerfile/Containerfile:
The shell form prevents any
CMD
orrun
command line arguments from being used, but has the disadvantage that yourENTRYPOINT
will be started as a subcommand of/bin/sh -c
, which does not pass signals. This means that the executable will not be the container’sPID 1
- and will not receive Unix signals - so your executable will not receive aSIGTERM
fromdocker stop <container>
. -> https://docs.docker.com/engine/reference/builder/#entrypoint
I’m starting to write the basic for spawning a container, listing them etc. I use labels to store a container info.
I’m also getting to know podman’s pod, which I think would become handy for grouping containers of only one project (e.g. apache + php + mysql): https://www.cloudreach.com/en/technical-blog/containerize-this-how-to-use-php-apache-mysql-within-docker-containers/. I originally wanted to have one container per project, but that require to build a containerfile that launch (in this case) 3 containers. It doesn’t scale well, takes time, and the commendation for containers is to have a single process as PID 1, to handle graceful shutdown.