1.1 KiB
1.1 KiB
Alpine with S6-Overlay
I want a docker image that behaves more like a VM:
- I can start / stop many processes, also the main process (usually PID 1) Why? To test things out. Changing environment variables, debugging with the coredump file or recompiling the app without crashing the container follows much more my development process
- Logging to a seperate file with logrotation Why? Docker logs (and Kibana) are a pain in the ass!
- Watchdog: k8s restarts containers when they are crashing. That should be done by the s6-overlay.
Tested
- Starting & Stopping services with
s6-rc start myappands6-rc stop myapp - Watchdog: Restart works, tested with
kill docker execinto the container and run myapp manually, it uses the env vars of the shell- Logging:
/var/log/myapp/currentis filled - Logrotation: With
ps aufxww, you can see thats6-log -b -- n20 s1000000 T /var/log/myappis running, which means that it rotates when the file becomes 1MB, it keeps 20 files and withTprepends ISO 8601 timestamp to each line - Cron
- Coredump