22 Unstar Star 64 Fork 42

Wizard / dockercomposesShell

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

docker-composes

整理一些自己常用的docker镜像

Swarm

初始化

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.

Portainer

参考链接: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

Network

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官方镜像的时候速度较慢,推荐两个国内的加速器。都还好,相互替补吧

Comments ( 1 )

Sign in for post a comment

About

常用的docker-compose.yml spread retract
Cancel

Releases

No release

Gitee Metrics

Contributors

All

Activities

load more
can not load any more
Shell
1
https://gitee.com/xbug_xyz/dockercomposes.git
git@gitee.com:xbug_xyz/dockercomposes.git
xbug_xyz
dockercomposes
dockercomposes
master

Search