Last active
March 4, 2022 09:52
-
-
Save jepio/a1d801062e8515665e07ca5e71e028b4 to your computer and use it in GitHub Desktop.
Flatcar Container Linux config snippet to run container at boot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"ignition":{"config":{},"security":{"tls":{}},"timeouts":{},"version":"2.3.0"},"networkd":{},"passwd":{},"storage":{},"systemd":{"units":[{"contents":"[Unit]\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nRestart=always\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker rm --force nginx\nExecStart=/usr/bin/docker run --rm --pull always --name nginx -p 80:80 nginx\nExecStop=-/usr/bin/docker stop nginx\n\n[Install]\nWantedBy=default.target\n","enabled":true,"name":"container.service"}]}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemd: | |
units: | |
- name: container.service | |
enabled: true | |
contents: | | |
[Unit] | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
Restart=always | |
TimeoutStartSec=0 | |
ExecStartPre=-/usr/bin/docker rm --force nginx | |
ExecStart=/usr/bin/docker run --rm --pull always --name nginx -p 80:80 nginx | |
ExecStop=-/usr/bin/docker stop nginx | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment