安装docker

脚本一键安装(官方)

https://docs.docker.com/engine/install/ubuntu/

curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl status docker
systemctl enable docker

安装Portainer

搜索官方源里的镜像

docker search portainer


root@Wygdbb:~# docker search portainer
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
portainer/portainer Making Docker management easy. https://porta… 1773
portainer/agent An agent used to manage all the resources in62
portainer/templates App Templates for Portainer http://portainer… 17
lihaixin/portainer docker ui 13 [OK]
portainerci/portainer Portainer images automatically created via P… 4
portainer/golang-builder Utility to build Golang binaries. 4 [OK]
greenled/portainer-stack-utils Bash scripts to deploy/undeploy stacks in a … 3 [OK]
portainer/base Multi-stage build image to create the Portai… 2 [OK]
hassioaddons/portainer 2
stefanscherer/portainer Portainer for Windows 1809 and some older In… 2
softonic/portainer-endpoint Allows auto register all the swarm nodes in1 [OK]
j0nnylester/portainer portainer running on a Raspberry Pi 1
portainer/portainer-k8s-beta Portainer for Kubernetes BETA 1
hassioaddons/portainer-amd64 0
nenadilic84/portainer 0
11384eb/portainer 0
portainerci/agent Portainer agent images automatically created… 0
agiper/portainer 0
rancher/portainer-agent 0
hassioaddons/portainer-armv7 0
webdevsvc/portainer portainer 0 [OK]
profidata/portainer Fork of portioner/portainer 0
rodjers/portainer Swarm portainer 0
helloysd/portainer 0
iconviet/portainer 0
root@Wygdbb:~#

拉取Portainer

docker pull portainer/portainer

docker images

运行Portainer

Portainer支持单机管理,Portainer也支持集群管理。这里我是单机管理

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

# --name 定义容器名
# -p 9000:9000 定义9000端口

查看所有容器

docker ps

设置Portainer

设置admin密码

设置本地管理