Skip to content

Commit

Permalink
Add information about automatically starting Podman containers
Browse files Browse the repository at this point in the history
  • Loading branch information
blast007 committed Feb 20, 2024
1 parent a3cd157 commit 730c047
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.Container
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build argument:
docker build . -t bzflag-server:latest --build-arg plugins="UselessMine,mapchange"

It is also possible to supply custom arguments to the configure script:
docker build . -t bzflag-server:latest --build-arg configure="--enable-debug --enable-custom-plugins-file=plugins.txt"
docker build . -t bzflag-server:latest --build-arg configure="--enable-custom-plugins-file=plugins.txt"


Running a self-built image
Expand All @@ -29,6 +29,17 @@ Start a server that automatically starts when the system boots up (and restarts
docker run -d --restart unless-stopped -p 0.0.0.0:5154:5154/tcp -p 0.0.0.0:5154:5154/udp -v /srv/bzfs/5154:/data \
--name bzfs5154 bzflag-server:latest -conf config

Note that podman does not automatically start containers when the host system reboots. You must externally manage them
with some other method, such as a systemd unit. Podman supports the generation of unit files. Build and run the
container first. Then you need to use loginctl to enable linger so that the user unit can start without requiring you to
first log in to the user. Then you use podman to generate a systemd unit and enable it.
sudo loginctl enable-linger UsernameHere
mkdir -p ~/.config/systemd/user/
podman generate systemd --new --name bzfs5154 > ~/.config/systemd/user/bzfs5154.service
podman stop bzfs5154 && podman rm bzfs5154
systemctl --user daemon-reload
systemctl --user enable bzfs5154.service --now

List running and stopped containers:
docker ps -a

Expand Down

0 comments on commit 730c047

Please sign in to comment.