获取portainer镜像
docker pull portainer/portainer:1.24.2
创建挂在的文件夹
进入/volume1/docker/
文件夹创建portainer所需文件夹
cxloge@synocxloge:~$ cd /volume1/docker/ cxloge@synocxloge:/volume1/docker$ mkdir -p portainer/1.24.2/data
docker-cli.sh
sudo -i # 切换到root权限 docker run -d \ --restart=always \ --name=portainer-9000 \ -p 9000:9000 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $(pwd)/data:/data \ portainer/portainer:1.24.2
docker-compose.yml
cat >> docker-compose.yml<<EOF version: '3.1' services: portainer: image: portainer/portainer:1.24.2 container_name: portainer-9000 restart: always volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "./data:/data" ports: - "9000:9000" EOF
根据已编排好的docker-compose.yml启动容器docker-compose up -d
root@synocxloge:/volume1/docker/portainer/1.24.2# ls data docker-compose.yml root@synocxloge:/volume1/docker/portainer/1.24.2# docker-compose up -d [+] Running 1/1 ⠿ Container portainer-9000 Started 5.9s root@synocxloge:/volume1/docker/portainer/1.24.2# docker ps | grep portainer 3bad9253ff2e portainer/portainer:1.24.2 "/portainer" 36 seconds ago Up 30 seconds 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp portainer-9000
使用
http://192.168.31.37:9000/#/init/admin
The password must be at least 8 characters long
Information Manage the Docker environment where Portainer is running. Ensure that you have started the Portainer container with the following Docker flag: -v "/var/run/docker.sock:/var/run/docker.sock" (Linux). or -v \\.\pipe\docker_engine:\\.\pipe\docker_engine (Windows).
参考资料
群晖DSM系统docker管理工具:portainer的安装教程和汉化及portainer常用模块功能
https://mp.weixin.qq.com/s/XTnTFuG3X3ikmSSA86L7FA
原文链接:https://www.cnblogs.com/cxloge/p/17538723.html
© 版权声明
声明📢本站内容均来自互联网,归原创作者所有,如有侵权必删除。
本站文章皆由CC-4.0协议发布,如无来源则为原创,转载请注明出处。
THE END