-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPodman Basics.txt
More file actions
52 lines (31 loc) · 1.1 KB
/
Podman Basics.txt
File metadata and controls
52 lines (31 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Podman Basics
podman info
podman ps --all
podman images
podman pull <image>
podman run -it <image>
podman run -d --name test_container <image>
podman exec -it test_container /bin/bash
podman start test_container
podman stop test_container
podmam rm -a
podman rmi <image>
skopeo inspect <image>
Setup Container to Run as Systemd Service (Rootless Mode)
---------------------------------------------------------------------------------
Create config directory in home to store systemd files
mkdir ~/.config/systemd/user
Launch the container
podman run -d --name test_container -p 80:8080 <image>
Generate systemd unit files
podman generate systemd --name test_container --files --new
Inspect new systemd unit file
less ~/.config/systemd/user/test_container.service
Enable linger to allow for persistent non-root systemd containers to run
loginctl enable-linger
loginctl show-user cloud_user | grep linger
"Linger=yes"
Reload daemon files (at the user level)
systemctl --user daemon-reload
Enable new container service (at the user level)
systemctl --user enable --now test_container.service