by sickcodebruh · 7y ago · 0 comments
I have an application with a long, tedious setup process involving dozens of apt dependencies that I don’t maintain. In the past, I’ve had issues with things not updating properly, inconsistencies between versions, spontaneous breakages... Using Docker, I built an image that contains all the dependencies that are unrelated to my code or configuration, then another image relies on this and contains all of my stuff. My deployment process only needs to be concerned with updating this second image and all of the frightening dependencies are guaranteed to be consistent and reliable. This second image is deployed to each box. All of the production systems are identical and if I need a new production box, I can have it ready to go in minutes and be confident that it will work and behave reliably.
How, may I ask? I've been looking for a good way to do this for a long time; nowadays I'm using a checklist and AMIs on AWS.
Ansible is too damn slow, does not know how config files work and clutters the terminal/my home directory/my known_hosts.
Dockerfile is a badly written shell script using && instead of errexit.
FROM quay.io/my-acct/my-image:lateststart-daemon && configure-daemon-while-running && stop-daemon
The point is, I've seen far more && than RUN directives so the decision was backwards.