sudo docker volume create portainer_data
sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
Web访问 127.0.0.1:9000
user: admin
password: tryportainer
docker-compose
curl -L https://downloads.portainer.io/portainer-agent-stack.yml -o portainer-agent-stack.yml
docker stack deploy --compose-file=portainer-agent-stack.yml portainer
编写docker-compose.yml 文本本件
1、创建docker-compose.yml
touch docker-compose.yml
2、编辑 vim docker-compose.yml
3、写入内容
version: '2'
services:
portainer:
image: portainer/portainer
restart: always
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /data/docker/portainer/data:/data
浏览器中输入http://ip:9000即可访问
用户名默认 admin
密码为宿主机密码
cat >>docker-compose.yml <<'EOF'
version: '2'
services:
portainer:
image: portainer/portainer
command: -H unix:///var/run/docker.sock
restart: always
ports:
- 9000:9000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
volumes:
portainer_data:
EOF
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:Docker 图形化管理工具Portainer.io - Python技术站