sh 安装Docker和Docker Compose

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 安装Docker和Docker Compose相关的知识,希望对你有一定的参考价值。

#! /bin/bash
set -x
set -e

sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce

### enable docker commands without sudo
# sudo groupadd docker
# sudo usermod -aG docker $USER

# Check Docker Compose version here: https://github.com/docker/compose/releases
DOCKER_COMPOSE=1.22.0
sudo curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo curl -L https://raw.githubusercontent.com/docker/compose/$DOCKER_COMPOSE/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose

以上是关于sh 安装Docker和Docker Compose的主要内容,如果未能解决你的问题,请参考以下文章

docker-compose安装

docker-compose安装

企业私有docker仓库---部属篇

sh 安装Docker和Docker Compose

docker--docker-Compose安装与使用

sh 安装Docker和Docker撰写Ubuntu 16.04