# 創(chuàng)建卷
dongsheng@dongsheng-virtual-machine:~$ docker volume create portainer_data
portainer_data
# 查看卷
dongsheng@dongsheng-virtual-machine:~$ docker volume ls
# 查看卷詳細信息
dongsheng@dongsheng-virtual-machine:~$ docker volume inspect portainer_data
# 下載并運行portainer鏡像
dongsheng@dongsheng-virtual-machine:~$ docker run -d -p 8000:8000 -p 9443:9443 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
# 設置賬號密碼,不少于12位即可
# 訪問地址
http://127.0.0.1:9000/
# Home--> Live connect ,即可鏈接上本地的docker
參考:
https://blog.csdn.net/Dontla/article/details/132212623