mirror of
https://github.com/AlexBocken/mykb.git
synced 2024-11-23 11:49:36 +01:00
added docker
This commit is contained in:
parent
121e3224ea
commit
5b03c28feb
34
docs/docker.md
Normal file
34
docs/docker.md
Normal file
@ -0,0 +1,34 @@
|
||||
# Docker
|
||||
General tips and tricks around docker, as it's usage has become unavoidable.
|
||||
|
||||
## Docker compose as systemd services
|
||||
You will be able to start any docker compose program via `systemctl start docker-compose@<program>`.
|
||||
|
||||
Create the file `/etc/systemd/system/docker-compose@.service` with the following content:
|
||||
```
|
||||
[Unit]
|
||||
Description=%i service with docker compose
|
||||
PartOf=docker.service
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
WorkingDirectory=/etc/docker/compose/%i
|
||||
ExecStart=/usr/bin/docker compose up -d
|
||||
ExecStop=/usr/bin/docker compose stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Create directories as necessary and place your `docker-compose.yml` in an appropriately named folder (as an example: "myprogram") in `/etc/docker-compose`.
|
||||
Ergo: Your docker-compose.yml should be in `/etc/docker/compose/myprogram/docker-compose.yml`.
|
||||
|
||||
Reload the daemon and start your service:
|
||||
```
|
||||
systemctl daemon-reload
|
||||
sysetmctl start docker-compose@myprogram
|
||||
```
|
||||
More ideas:
|
||||
https://gist.github.com/mosquito/b23e1c1e5723a7fd9e6568e5cf91180f
|
1
index.md
1
index.md
@ -24,6 +24,7 @@ Happy to accept pull requests for new topics!
|
||||
- [git](docs/GIT.md) version control software
|
||||
- [rainloop](docs/rainloop.md) webbased email client
|
||||
- [anki sync server](anki_sync_server.md) personal sync server for anki, a spaced repetition learning program
|
||||
- [docker](docs/docker.md) General tips and tricks around the container manager
|
||||
|
||||
# Admin
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user