1 Star 0 Fork 31

就吃鱼丸粗面 / dockercomposes

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

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

BSD 3-Clause License Copyright (c) 2017, Wizard(lsw1991abc@gmail.com) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

常用的docker-compose.yml 展开 收起
Shell
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Shell
1
https://gitee.com/xifan.org/dockercomposes.git
git@gitee.com:xifan.org/dockercomposes.git
xifan.org
dockercomposes
dockercomposes
master

搜索帮助

14c37bed 8189591 565d56ea 8189591