lcsavb / ac2

MIT License
0 stars 0 forks source link

Docker image #3

Open lcsavb opened 9 months ago

lcsavb commented 9 months ago

Two ideas for the docker image:

  1. Minimal base: https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://github.com/CrafterKolyan/tiny-python-docker-image&ved=2ahUKEwifi-zJzsGCAxUOcPEDHb_QDaQQFnoECAwQAQ&usg=AOvVaw0ao6uf6_CFeZwwFB14GWAK

  2. Multistage build

lcsavb commented 9 months ago

One addendum: Using a pre-built distro defies the nature of the nix approach a little. Nix is all about very specific version control of all(!) elements in your software stack. If you then use a distro which can change its contents (worst: alpine:latest) you cannot be sure to get reproducibility. Not a big issue now, but I wanted to clarify it :-) Basically, with nix you'd build the docker container from a blank template. With the multistage build you can then strip away all things that are not needed after the build process. This works best for binary applications which are the only thing in the container then and yield extremely small containers. With Python and Django you will have some overhead, but again don't optimize these at the moment. [Ontem 06:45] Dominik Böhler More here: https://grahamc.com/blog/nix-and-layered-docker-images/ Optimising Docker Layers for Better Caching with Nix - Graham Christensen