项目地址:https://hub.docker.com/r/portainer/portainer-ce
- 简介:
Portainer 是 Docker 的图形化管理工具,提供状态显示面板、应用模板快速部署、容器镜像网络数据卷的基本操作(包括上传下载镜像,创建容器等操作)、事件日志显示、容器控制台操作、Swarm 集群和服务等集中管理和操作、登录用户管理和控制等功能。功能十分全面,基本能满足中小型单位对容器管理的全部需求。
- 部署过程
docker pull portainer/portainer-ce docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --restart=always --name prtainer portainer/portainer-ce
- 使用
1)登录ip:9000
首次需要设置用户名密码
2)管理对象
管理Portainer运行的docker环境,需要选择Local,如管理远端的docker环境,需要选择Remote,如下图,
3)主面板
4)管理容器
5)管理镜像
6)其他
7)nginx反代
# WebSocket map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 80; listen [::]:80; listen 443 ssl http2; listen [::]:443 ssl http2; server_name c1.fanlog.org; index index.html index.php; root /home/wwwroot/c1.fanlog.org; #443强制转换 if ($server_port !~ 443){ rewrite ^(/.*)$ https://$host$1 permanent; } ssl_certificate /etc/letsencrypt/live/c1.fanlog.org/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/c1.fanlog.org/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/c1.fanlog.org/fullchain.pem; # add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' ;script-src 'self' 'unsafe-inline' 'unsafe-eval' "; location ~ "^/cloud/portainer(/?.*)" { proxy_pass http://127.0.0.1:9001$1$is_args$args; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
测试通过
参考资料:
- https://www.jianshu.com/p/575de760bfd4
- https://www.cjavapy.com/article/2235/
- https://blog.csdn.net/youlinhuanyan/article/details/113814285
- https://www.modb.pro/db/395327
- https://learnku.com/articles/43670#:~:text=Portainer%20%E6%98%AFDocker%20%E7%9A%84%E5%9B%BE%E5%BD%A2,%E5%AE%B9%E5%99%A8%E7%AE%A1%E7%90%86%E7%9A%84%E5%85%A8%E9%83%A8%E9%9C%80%E6%B1%82%E3%80%82
- https://codeleading.com/article/87134351260/