How to install docker compose

In this tutorial, How to install docker compose on centos. First of all, installed docker on your system. In this preview, Install docker and learn containers on Centos.

What is Docker compose?

Docker compose is tool orchestration manage containers, defining and running multi-container Docker applications, it’s working multiple containers docker application and use the compose file in the YAML format.

How to install docker compose on Centos

Install docker compose on centos 6

The docker compose the latest version, To check the https://github.com/docker/compose/releases

# curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose

To check docker compose version:

# docker-compose -v

The screen output terminal:

docker-compose version 1.16.1, build 6d1ac21

Install docker compose on centos 7

To install docker compose

# yum install -y python-pip
# pip install docker-compose

To upgrade all the python packages on Centos 7

# yum upgrade python*

The screen output terminal:

docker-compose version 1.16.1, build 6d1ac21

Testing Docker Compose

To create a new directory and move into it

 $ mkdir hello-world
 $ cd hello-world

To create a new YAML file

$ vim docker-compose.yml

The content file docker-compose.yml as below

 devopsroles-test:
 image: hello-world

To save and exit

To rune the container

$ sudo docker-compose up

The screen output terminal:

 $ docker-compose up
 Pulling devopsroles-test (hello-world:latest)...
 latest: Pulling from hello-world

3619f633e2e6: Pulling fs layer
 3619f633e2e6: Downloading [==================================================>] 3619f633e2e6: Extracting [==================================================>] 93619f633e2e6: Extracting [==================================================>] 93619f633e2e6: Pull complete
 bef02f2f6467: Extracting [==================================================>] bef02f2f6467: Extracting [==================================================>] bef02f2f6467: Pull complete
 Digest: sha256:a69dda95faa021234ab2d92118e9539d0175b46587803e32435ea2e534f2db06
 Status: Downloaded newer image for hello-world:latest
 Creating helloworld_devopsroles-test_1...
 Attaching to helloworld_devopsroles-test_1
 devopsroles-test_1 |
 devopsroles-test_1 | Hello from Docker!
 devopsroles-test_1 | This message shows that your installation appears to be working correctly.
 devopsroles-test_1 |
 devopsroles-test_1 | To generate this message, Docker took the following steps:
 devopsroles-test_1 | 1. The Docker client contacted the Docker daemon.
 devopsroles-test_1 | 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 devopsroles-test_1 | 3. The Docker daemon created a new container from that image which runs the
 devopsroles-test_1 | executable that produces the output you are currently reading.
 devopsroles-test_1 | 4. The Docker daemon streamed that output to the Docker client, which sent it
 devopsroles-test_1 | to your terminal.
 devopsroles-test_1 |
 devopsroles-test_1 | To try something more ambitious, you can run an Ubuntu container with:
 devopsroles-test_1 | $ docker run -it ubuntu bash
 devopsroles-test_1 |
 devopsroles-test_1 | Share images, automate workflows, and more with a free Docker ID:
 devopsroles-test_1 | https://cloud.docker.com/
 devopsroles-test_1 |
 devopsroles-test_1 | For more examples and ideas, visit:
 devopsroles-test_1 | https://docs.docker.com/engine/userguide/
 devopsroles-test_1 |

Conclusion

Through the article, you can use How to install docker compose as above. I hope will this your helpful. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology, especially Devops Skill such as Docker, vagrant, git, and so forth. I like open-sources, so I created DevopsRoles.com to share the knowledge I have acquired. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

1 thought on “How to install docker compose

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.