docker compose
2022-12-05
安装
ec2 安装 docker compose
# 更新实例上已安装的程序包和程序包缓存
sudo yum update -y
# 安装最新的 Docker Engine 程序包
sudo amazon-linux-extras install docker
# 启动 Docker 服务
sudo service docker start
sudo systemctl enable docker
# 将 ec2-user 添加到 docker 组,以便您能够执行 Docker 命令,而无需使用 sudo
sudo usermod -a -G docker ec2-user
# aws ec2 安装docker-compose 针对 aarch64 机器
# 安装pip(针对以上机型相符)
sudo yum install -y python37 \
python3-devel.$(uname -m) libpython3.7-dev \
libffi-devel openssl-devel
sudo yum groupinstall -y "Development Tools"
sudo python3 -m pip install -U pip
sudo python3 -m pip install docker-compose
# 验证
docker-compose --version
普通系统安装
https://github.com/docker/compose/releases
#
curl -L "https://github.com/docker/compose/releases/download/1.29.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose