Last active
March 26, 2019 03:52
-
-
Save ledangtuanbk/6a9c85aa81c2cfc6e6dfee3a29e8bc0a to your computer and use it in GitHub Desktop.
install docker and docker compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install Docker & Docker Compose - Centos 7 | |
Step 1 — Install Docker | |
Install needed packages: | |
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2 | |
Configure the docker-ce repo: | |
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
Install docker-ce: | |
$ sudo yum install docker-ce -y | |
Add your user to the docker group with the following command. | |
$ sudo usermod -aG docker $(whoami) | |
Set Docker to start automatically at boot time: | |
$ sudo systemctl enable docker.service | |
Finally, start the Docker service: | |
$ sudo systemctl start docker.service | |
Step 2 — Install Docker Compose | |
Install Extra Packages for Enterprise Linux | |
$ sudo yum install epel-release | |
Install python-pip | |
$ sudo yum install -y python-pip | |
Then install Docker Compose: | |
$ sudo pip install docker-compose | |
You will also need to upgrade your Python packages on CentOS 7 to get docker-compose to run successfully: | |
$ sudo yum upgrade python* | |
To verify a successful Docker Compose installation, run: | |
$ docker-compose version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
echo "Install needed packages"
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
echo "Configure the docker-ce repo"
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
echo "Install docker-ce"
sudo yum install docker-ce -y
echo "Add your user to the docker group with the following command"
sudo usermod -aG docker $(whoami)
echo "Set Docker to start automatically at boot time"
sudo systemctl enable docker.service
echo "Finally, start the Docker service"
sudo systemctl start docker.service