系统版本 24.04.3 LTS

安装命令
sudo apt update
sudo dpkg --configure -a
sudo apt install podman
podman version
podman pull nginx :latest
podman pull nginx
# 1. 停止当前容器
podman stop nginx
# 2. 删除容器
podman rm nginx
# 3. 检查80端口是否被占用
sudo netstat -tulpn | grep :80
# 4. 重新创建容器,使用80端口映射
podman run -d -p 80:80 -p 8080:8080 --name nginx --restart=always -v /opt/nginx/conf.d:/etc/nginx/conf.d:Z -v /opt/nginx/html:/usr/share/nginx:Z nginx
# 5. 验证新端口映射
podman port nginx
| 作者:chenze 出处:https://www.cnblogs.com/chenze-Index/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 如果文中有什么错误,欢迎指出。以免更多的人被误导。 |