How to Setup Docker Compose on Ubuntu in Azure/AWS/GCP

To run the Docker Compose on Linux in Azure, AWS or GCP, the best way is to install the Docker Compose image from the marketplace.  It comes preinstalled with Docker Engine Community and is fully configured as per the requirements to run Docker Compose in the cloud. Click on the links below to deploy into your environments

Getting Started with Docker Compose

Once your Docker Compose server has been deployed, the following links explain how to connect to a Linux VM:

 

 

Once connected and logged in, the following section explains how to start using Docker Compose

Using Docker Compose

Once logged in via your terminal you are ready to get started. (Note: depending on the type of containers you would like to build, make sure you have the correct firewall ports open. Refer to the section Docker Compose Firewall Ports, further down.

Test Docker Engine

To verify that Docker Engine is working correctly, type the following command 

				
					sudo docker run hello-world
				
			

This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits as per the following screenshot:

docker run hello world

If you receive a message ‘Cannot connect to the Docker daemon‘, means that you will need to start the Docker service. Run the following command:

				
					sudo systemctl start docker
				
			

Or

				
					sudo service docker start
				
			

Then re run the command to verify Docker is running 

				
					sudo docker run hello-world
				
			

Test Docker Compose

Run the following command to confirm Docker Compose is installed. Depending on which version you have installed, run one of the following commands:

				
					docker compose version
				
			

If you receive a message command not found, try:

				
					docker-compose -version
				
			

If you receive the version of Docker Compose, you’ve confirmed Docker Compose is installed. You’re now ready to start using Docker Compose.

Docker Compose Firewall Ports

Depending on the type of containers you will be creating, you’ll need to make sure your Docker server has the required ports open, in order for them to communicate on your network. The following guides show the steps to setup firewall rules for each cloud provider:

 

To setup AWS firewall rules refer to – AWS Security Groups

To setup Azure firewall rules refer to – Azure Network Security Groups

To setup Google GCP firewall rules refer to – Creating GCP Firewalls

Documentation

Please refer to Dockers documentation on how to use Docker Compose

 

https://docs.docker.com/compose/gettingstarted/

Support

Any questions regarding the installation of this solution, please leave a comment below or contact us and we will assist as much as we can to help you get Docker up and running in your environment.

 

Disclaimer: Docker is a registred trademark of Docker Inc and is licensed under Apache LicenseV2.  This image is maintained by Cloud Infrastructure Services.  No warrantee of any kind, express or implied, is included with this software. Use at your risk, responsibility for damages (if any) to anyone resulting from the use of this software rest entirely with the user. The author is not responsible for any damage that its use could cause.

Avatar for Andrew Fitzgerald
Andrew Fitzgerald

Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.

3 2 votes
Article Rating
Subscribe
Notify of
0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x