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
Once your Docker Compose server has been deployed, the following links explain how to connect to a Linux VM:
- How to connect to a Linux VM on Azure
- How to connect to a Linux VM on AWS
- How to connect to a Linux VM on GCP
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 your 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:
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:
Azure / AWS Customers
For Docker version, Try :
docker-compose -version
or
docker compose version
GCP Customers
Docker compose version 2, try :
docker compose version
The Docker Compose version should be displayed.
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
Docker Compose Documentation
Please refer to Dockers documentation on how to use Docker Compose
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. 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.
Related Posts:
- How to Setup Docker Compose on Windows Server in Azure/AWS/GCP
- How to Setup Ruby Docker Container using Docker Compose
- How to Setup Cassandra Docker Container using Docker Compose
- How to Create PostgreSQL Docker Image Container (Docker-Compose)
- Create Apache Spark Docker Container using Docker-Compose
- How to Install and Use Docker Compose on Ubuntu 20.04 Tutorial