安装docker-compose(国内高速镜像)
gihub上下载docker-compose太慢了,下载不动,只能换成国内镜像(daocloud.io)来下载。
下载
for docker(1.13.xx)
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
for docker-ce(17+)
curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
for docker-ce(20+)
#curl -L "https://get.daocloud.io/docker/compose/releases/download/v2.2.3/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.6.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
文件大小大概40M+,如果不对,或者报错,请使用:
https://blog.peos.cn/wp-content/uploads/2022/03/docker-compose-linux-x86_64_v2.1.6.zip
或:
https://blog.peos.cn/wp-content/uploads/docker-compose-linux-x86_64_v2.1.6
下载 完成后:
chmod +x /usr/local/bin/docker-compose
docker-compose --version
相关资源:
docker-compose: docker-compose集成环境系列 (gitee.com)
DOCKER国内镜像
创建或修改 /etc/docker/daemon.json 文件,修改为如下形式
{ "registry-mirrors": [ "https://registry.docker-cn.com", "http://hub-mirror.c.163.com", "https://docker.mirrors.ustc.edu.cn" ] }
docker-compose.yml文件示例:
version :'3'
services:
mysql:
container_name: mysql
image: mysql:5.7
build:
context:./mysql
ports:
-"3307:3306"
volumes:
-./mysql/conf:/etc/mysql/conf.d
-./mysql/logs:/logs
-./mysql/data:/var/lib/mysql
-./mysql/init-sql/:/docker-entrypoint-initdb.d
command:[
'mysqld',
'--innodb-buffer-pool-size=80M',
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci',
'--default-time-zone=+8:00',
'--lower-case-table-names=1'
]
environment:
MYSQL_DATABASE:'virbac'
MYSQL_ROOT_PASSWORD:'123456'
restart: always
api:
container_name: api
image: virbac-api
build:
context: virbac-api
dockerfile:Dockerfile
ports:
-"8000:8000"
depends_on:
- mysql
links:
- mysql:mysql
restart: always
linux一键安装docker:
rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 curl -fsSL get.docker.com -o get-docker.sh \ && sudo sh get-docker.sh --mirror Aliyun \ && sudo systemctl enable docker \ && sudo systemctl start docker \ && sudo groupadd -f docker \ && sudo usermod -aG docker $USER \ && sudo mkdir -p /etc/docker \ && sudo newgrp docker \ && sudo echo -e '{\n "registry-mirrors":["https://9zufkov1.mirror.aliyuncs.com"]\n}'>>/etc/docker/daemon.json \ && sudo systemctl daemon-reload \ && sudo systemctl restart docker \ && sudo svstemctl enable docker
============ 欢迎各位老板打赏~ ===========
与本文相关的文章
- · docker-compose安装phpmyadmin
- · Amazon Linux 2023 安装Docker和Docker Compose
- · linux使用docker-compose安装和破解confluence 8.0.2
- · docker-compose通过容器名连接mysql
- · mac os m1可用的NACOS
- · 修改Docker的默认网段
- · docker定时任务Mysql脚本
- · 解决Linux实例磁盘空间满问题
- · failed to fetch metadata: fork/exec /home/appuser/.docker/cli-plugins/docker-buildx: exec format error
- · Docker登录login报错Error saving credentials
- · ELK/EFK中ES使用IK分词器的方式步骤
- · 解决es报错:blocked by: [FORBIDDEN/12/index read-only / allow delete (api) ]