实验前提:配置主机有网,并且配置镜像加速器
拉取portainer镜像
[root@server1 ~]# docker search portainer ##查找镜像
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
portainer/portainer Making Docker management easy. https://porta… 1212
portainer/agent An agent used to manage all the resources in… 33
portainer/templates App Templates for Portainer http://portainer… 14
lihaixin/portainer docker ui 5 [OK]
portainer/golang-builder Utility to build Golang binaries. 4 [OK]
portainerci/portainer Portainer images automatically created via P… 2
stefanscherer/portainer Portainer for Windows 1809 and some older In… 2
[root@server1 ~]# docker pull portainer/portainer ##拉取官方镜像
Using default tag: latest
latest: Pulling from portainer/portainer
d1e017099d17: Pull complete
fac26901c311: Pull complete
Digest: sha256:cc226d8a06b6d5e24b44a4f10d0d1fd701741e84a852adc6d40bef9424a000ec
Status: Downloaded newer image for portainer/portainer:latest
[root@server1 ~]# docker images ##查看镜像是否拉取成功
REPOSITORY TAG IMAGE ID CREATED SIZE
portainer/portainer latest da2759008147 6 weeks ago 75.4MB
k8s.gcr.io/coredns 1.2.2 95b66263fd52 7 months ago 39.2MB
k8s.gcr.io/etcd 3.2.24 b57e69295df1 7 months ago 220MB
k8s.gcr.io/pause 3.1 6ce64a260657 7 months ago 742kB
k8s.gcr.io/kube-proxy v1.12.2 96eaf5076bfe 7 months ago 96.5MB
k8s.gcr.io/kube-scheduler v1.12.2 a84dd4efbe5f 7 months ago 58.3MB
k8s.gcr.io/kube-controller-manager v1.12.2 b9a2d5b91fd6 7 months ago 164MB
k8s.gcr.io/kube-apiserver v1.12.2 6e3fa7b29763 7 months ago 194MB
quay.io/coreos/flannel v0.10.0-amd64 f0fad859c909 17 months ago 44.6MB
集群状态下运行portainer
集群创建以上节swarm创建docker集群为例
启动portainer
[root@server1 ~]# docker run -d -p 9000:9000 --restart=always --name prtainer-test portainer/portainer ##用宿主机9000端口关联容器中的9000端口,并给容器起名为portainer-test。启动成功后,使用该机器IP:PORT即可访问Portainer
1c4ce756f8a410d5d0d48cfebcefbd6aba6b549744562ea8239f46698a932503
浏览器端访问:http://172.25.4.111:9000
首次访问需要注册用户–密码:westosredhat
单击选择remote