Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| docker_notes:init [2024-08-04 Sun wk31 13:36] – [s6 Service Driectories] baumkp | docker_notes:init [2025-09-26 Fri wk39 19:37] (current) – [References] baumkp | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{tag> | + | {{tag> |
| ======Docker init Systems====== | ======Docker init Systems====== | ||
| - | There are a number of init systems used on docker containers, many are the defaults that ship with the standard Linux distributions, | + | There are a number of init systems used on docker containers, many are the defaults that ship with the standard Linux distributions, |
| + | ++++tldr; | ||
| + | There is a lot of argument in the init world, SystemD seems to have taken over the init system in most " | ||
| + | Some Unix (Linux focus) init systems: | ||
| + | *sysv (System V) | ||
| + | *[[https:// | ||
| + | *[[https:// | ||
| + | *[[https:// | ||
| + | *[[https:// | ||
| + | *[[http:// | ||
| + | *[[https:// | ||
| + | *And arguably not a full init systems: | ||
| + | *[[https:// | ||
| + | *[[http:// | ||
| + | ***launchd** is the process control system system used by Apple Max OS X, perhaps inspiration for systemd? | ||
| + | Some references (just do an online search....): | ||
| + | *[[https:// | ||
| + | *[[https:// | ||
| When creating my own imaged I have generally is the S6-RC init system, most if not all have been built on the latest Apline Linux as base image. Some examples: | When creating my own imaged I have generally is the S6-RC init system, most if not all have been built on the latest Apline Linux as base image. Some examples: | ||
| *[[https:// | *[[https:// | ||
| *[[https:// | *[[https:// | ||
| *[[https:// | *[[https:// | ||
| - | *mailserver | + | *mailserver |
| *[[https:// | *[[https:// | ||
| *[[https:// | *[[https:// | ||
| Line 16: | Line 32: | ||
| There are other init systems out there that I have not looked into, including a number of legacy init systems that are no longer supported. | There are other init systems out there that I have not looked into, including a number of legacy init systems that are no longer supported. | ||
| + | ++++ | ||
| =====s6 supervision rc system===== | =====s6 supervision rc system===== | ||
| I decided to build this container image based upon Alpine Linux using the [[https:// | I decided to build this container image based upon Alpine Linux using the [[https:// | ||
| Line 26: | Line 42: | ||
| The s6-rc service directories are stored at '' | The s6-rc service directories are stored at '' | ||
| ^ sub-directory | ^ sub-directory | ||
| - | | ├── named | *1 | Service, longrun type, as required | + | | ├── |
| - | | │ ├── dependencies.d | + | | │ ├── |
| | │ │ ├── base | | │ │ ├── base | ||
| | │ │ └── pre_start_script | | │ │ └── pre_start_script | ||
| Line 36: | Line 52: | ||
| fdmove -c 2 1 | fdmove -c 2 1 | ||
| / | / | ||
| - | | │ ├── timeout-down | + | | │ ├── timeout-down |
| | │ | | │ | ||
| - | | │ ├── timeout-up | + | | │ ├── timeout-up |
| | │ | | │ | ||
| - | | │ └── type | + | | │ └── type |
| | │ | | │ | ||
| | ├── named-log | | ├── named-log | ||
| Line 62: | Line 78: | ||
| ====s6 commands==== | ====s6 commands==== | ||
| ++++Basic S6 commands:| | ++++Basic S6 commands:| | ||
| - | |||
| *'' | *'' | ||
| *'' | *'' | ||
| Line 75: | Line 90: | ||
| ++++ | ++++ | ||
| + | =====docker builtin basic init===== | ||
| + | In the docker run command the '' | ||
| + | |||
| + | In docker compose add the directive '' | ||
| + | ++++docker-compose.yml snippet| | ||
| + | < | ||
| + | ntfy: | ||
| + | image: binwiederhier/ | ||
| + | init: true | ||
| + | container_name: | ||
| + | ++++ | ||
| + | |||
| + | *[[https:// | ||
| + | *[[https:// | ||
| + | *[[https:// | ||
| + | |||
| + | =====alias in S6 init===== | ||
| + | I like the alias command to change some default CLI command flags, in particular ls => ls -la, which I normally call ll. I had no success using the alias command in S6 init scripts. I found the following solution, by using the s6 pre_start_script to add a link '' | ||
| + | |||
| + | <code bash># | ||
| + | /bin/ln -s / | ||
| + | Where '' | ||
| + | <code bash># | ||
| + | exec ls -la " | ||
| =====References===== | =====References===== | ||
| - | *[[https:// | + | *[[https:// |
| *[[https:// | *[[https:// | ||
| *[[https:// | *[[https:// | ||