Skip to content

Commit

Permalink
rootles tutorial: remove systemd unit example
Browse files Browse the repository at this point in the history
The example was not entirely correct.  Users should use `podman generate
systemd` and use the output either directly or as a template for further
adjustments to their needs.  Keeping an example in the rootless tutorial
is a maintenance burdon and can easily suggest incorrect usage patterns
to users.

Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Mar 9, 2020
1 parent 220f9a7 commit 3c47368
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions docs/tutorials/rootless_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,6 @@ The Podman configuration files for root reside in `/usr/share/containers` with o

The default authorization file used by the `podman login` and `podman logout` commands reside in `${XDG_RUNTIME_DIR}/containers/auth.json`.

## Systemd unit for rootless container

```
[Unit]
Description=nginx
[email protected]
[email protected]
[Service]
Type=simple
KillMode=none
MemoryMax=200M
ExecStartPre=-/usr/bin/podman rm -f nginx
ExecStartPre=/usr/bin/podman pull nginx
ExecStart=/usr/bin/podman run --name=nginx -p 8080:80 -v /home/nginx/html:/usr/share/nginx/html:Z nginx
ExecStop=/usr/bin/podman stop nginx
Restart=always
User=nginx
Group=nginx
[Install]
WantedBy=multi-user.target
```

This example unit will launch a nginx container using the existing user nginx with id 1001, serving static content from /home/nginx/html and limited to 200MB of RAM.

You can use all the usual systemd flags to control the process, including capabilities and cgroup directives to limit memory or CPU.

See #3866 for more details.

## More information

If you are still experiencing problems running Podman in a rootless environment, please refer to the [Shortcomings of Rootless Podman](https://github.com/containers/libpod/blob/master/rootless.md) page which lists known issues and solutions to known issues in this environment.
Expand Down

0 comments on commit 3c47368

Please sign in to comment.