整理一些自己常用的docker镜像
初始化
docker swarm init
可配置的参数可以使用--help
查看
初始化后,会有以下提示
Swarm initialized: current node (xxxxxx) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-xxxxx <IP>:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
参考链接:https://www.portainer.io/installation/
方式有两种,代理和非代理
Note that the recommended deployment mode when using Swarm is using the Portainer Agent.
非代理
docker volume create portainer_data
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
代理
推荐使用,可以使用Swarm的特性,并且支持的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
Portainer
的运行,会创建自己用的几个network
docker network ls
如果想使用自定义的,也可以自己创建。使用docker-compose
时,对scope
有校验,所以要加--scope=swarm
docker network create --scope=swarm --driver=overlay --attachable mobe-network
设置容器的时间和主机的时间相同,启动时挂载到容器内
ln -s /etc/localtime /data/k8s-volume/common/timezone/localtime
ln -s /etc/timezone /data/k8s-volume/common/timezone/timezone
由于网络原因,在pull官方镜像的时候速度较慢,推荐两个国内的加速器。都还好,相互替补吧
aliyun.com 找 R容器服务
或者参考云栖社区的文章:Docker镜像加速器
Sign in to post a comment
Activity
Community
Health
Trend
Influence
:Code submit frequency
:React/respond to issue & PR etc.
:Well-balanced team members and collaboration
:Recent popularity of project
:Star counts, download counts etc.
Repository Comments ( 1 )