Skip to content

通过知识获得解放,通过技术获得自由

Menu
  • 专题目录
  • 液压相关
    • 液压技术
    • 液压相邻技术
    • 液压应用
  • 计算机相关
    • 计算机和软件
    • 网络和网站技术
  • 哲学
  • 关于本站
Menu

部署docker portainer管理容器[0]

Posted on 2023年11月14日 by

项目地址: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;
      }

}

测试通过

 

 

参考资料:

  1. https://www.jianshu.com/p/575de760bfd4
  2. https://www.cjavapy.com/article/2235/
  3. https://blog.csdn.net/youlinhuanyan/article/details/113814285
  4. https://www.modb.pro/db/395327
  5. 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
  6. https://codeleading.com/article/87134351260/

欢迎回来

希望本站对你有所帮助!

如有疑问请联系info@fanlog.org
2023 年 11 月
一二三四五六日
 12345
6789101112
13141516171819
20212223242526
27282930 
« 6 月    

AI辅助 (17)

© 2025 | Powered by Superbs Personal Blog theme
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT