Docker安装管理界面portainer

在Ubuntu或者Debian已经部署完毕Docker

拉取镜像文件:

sudo docker pull docker.io/portainer/portainer
Using default tag: latest latest: Pulling from portainer
/portainer d1e017099d17: Pull complete 8ca27898abd9: Pull complete Digest: sha256:166ea71afde944c36758bbe42389d18c100f431fe72aacdc2e8c32ae9d9f0535 Status: Downloaded newer image for portainer/portainer:latest

 安装指定版本(2018-09-13 1.19.1)

sudo docker pull portainer/portainer:1.18.1

 

Deploy Portainer

Use the following Docker commands to deploy Portainer:

sudo docker volume create portainer_data

 

sudo docker run -d -p 9000:9000 --name portainer --restart=always  -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer


或者手动执行设置为自动启动:

 设置自动启动容器portainer,9c676f48a499是安装后已经生成的容器ID。上面的命令在安装时已经设置。

sudo docker update --restart=always 9c676f48a499

 

在debian执行过程如下:

root@debian:~# docker pull docker.io/portainer/portainer
Using default tag: latest
latest: Pulling from portainer/portainer
d1e017099d17: Pull complete 
8ca27898abd9: Pull complete 
Digest: sha256:166ea71afde944c36758bbe42389d18c100f431fe72aacdc2e8c32ae9d9f0535
Status: Downloaded newer image for portainer/portainer:latest
root@debian:~# docker volume create portainer_data
portainer_data
root@debian:~# docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
5a9e7c4d7e1be0e1262fb255162a14608dbc54c8ca5c98ed492dfe4510913b35

 

portainer的镜像文件17M多。

浏览器输入http://192.168.0.2:9000,回车,跳转到初始化界面http://192.168.0.153:9000/#/init/admin

创建管理员用户名和密码,密码需要8位,点击Create user创建用户

下一个界面选择local本地运行吧。connect连接

 

写教程时安装版本位1.18.1

 

2018-07-23更新,安装于stick上

arrive@STK1AW32SC:~$ docker version
Client:
 Version:           18.06.0-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        0ffa825
 Built:             Wed Jul 18 19:09:54 2018
 OS/Arch:           linux/amd64
 Experimental:      false
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.38/version: dial unix /var/run/docker.sock: connect: permission denied
arrive@STK1AW32SC:~$ docker pull docker.io/portainer/portainer
Using default tag: latest
Warning: failed to get default registry endpoint from daemon (Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.38/info: dial unix /var/run/docker.sock: connect: permission denied). Using system default: https://index.docker.io/v1/
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.38/images/create?fromImage=portainer%2Fportainer&tag=latest: dial unix /var/run/docker.sock: connect: permission denied
arrive@STK1AW32SC:~$ sudo docker pull docker.io/portainer/portainer
Using default tag: latest
latest: Pulling from portainer/portainer
d1e017099d17: Pull complete 
8ca27898abd9: Pull complete 
Digest: sha256:166ea71afde944c36758bbe42389d18c100f431fe72aacdc2e8c32ae9d9f0535
Status: Downloaded newer image for portainer/portainer:latest
arrive@STK1AW32SC:~$ sudo docker volume create portainer_data
portainer_data
arrive@STK1AW32SC:~$ sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
6485b32c02bf1d0be02873da3c20238899a8aee3e1db98a21cd981f9b8e2b68b

 

官方安装介绍:

https://portainer.readthedocs.io/en/stable/deployment.html

$ docker volume create portainer_data
$ docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

 1.19.1支持导入导出镜像,很方便!

其他使用:

清理所有停止的容器

docker container prune

清理所有不用数据(停止的容器,不使用的volume,不使用的networks,悬挂的镜像)

docker system prune -a

清理所有停止的容器

docker container prune 




20200208 24.61m 版本1.23.0 --
posted @ 2018-04-25 10:50  新贵  阅读(4726)  评论(0编辑  收藏  举报