[student@servera ~]$ podman run -d --name restart-nginx -p 8080:80 nginx
✔ docker.io/library/nginx:latest
Trying to pull docker.io/library/nginx:latest...
Getting image source signatures
Copying blob 18f38162c0ce doneCopying blob c4ffe9532b5f doneCopying blob 08c3cb2073f1 doneCopying blob 10e2168f148a doneCopying blob 2215908dc0a2 doneCopying blob c229119241af doneCopying config 12766a6745 doneWriting manifest to image destination
Storing signatures
0f08d4f8e218a76ec4f4e68eb5bf04df518ee685825e6b49017f12ef718f4b7a
[student@servera ~]$ curl 127.0.0.1:8080
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark;}body { width: 35em; margin: 0 auto;font-family: Tahoma, Verdana, Arial, sans-serif;}</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
3.3.2 產生 User 的 systemd 目錄
1
2
3
4
5
[student@servera ~]$ mkdir -pv ~/.config/systemd/user/
mkdir: created directory '/home/student/.config'mkdir: created directory '/home/student/.config/systemd'mkdir: created directory '/home/student/.config/systemd/user/'[student@servera ~]$ cd ~/.config/systemd/
[student@servera user]$ systemctl --user enable container-restart-nginx.service --now
Created symlink /home/student/.config/systemd/user/multi-user.target.wants/container-restart-nginx.service → /home/student/.config/systemd/user/container-restart-nginx.service.
Unit /home/student/.config/systemd/user/container-restart-nginx.service is added as a dependency to a non-existent unit multi-user.target.
Created symlink /home/student/.config/systemd/user/default.target.wants/container-restart-nginx.service → /home/student/.config/systemd/user/container-restart-nginx.service.
[student@servera user]$ curl 127.0.0.1:8080
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark;}body { width: 35em; margin: 0 auto;font-family: Tahoma, Verdana, Arial, sans-serif;}</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
[student@servera ~]$ curl 127.0.0.1:8080
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark;}body { width: 35em; margin: 0 auto;font-family: Tahoma, Verdana, Arial, sans-serif;}</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>