• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

dockercomposes: 常用的docker-compose.yml

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

dockercomposes

开源软件地址:

https://gitee.com/xbug_xyz/dockercomposes

开源软件介绍:

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_datadocker 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.ymldocker 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/localtimeln -s /etc/timezone /data/k8s-volume/common/timezone/timezone

加速器

由于网络原因,在pull官方镜像的时候速度较慢,推荐两个国内的加速器。都还好,相互替补吧


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap