How to install Docker-compose on Deepin OS 20.9 or any other Debian-based Linux distribution via the terminal emulator?
Check your operating system
Click here in order to determine if your operating system is Debian-Based.
Knowing if your operating system is Debian-based is crucial for efficient system management and software compatibility.
If you prefer, you can copy and paste the following link into your address bar:
https://blog.alexandrecalaca.com/how-to-determine-if-your-linux-distribution-is-debian-based
Update package repository information
sudo apt-get update
Running sudo apt-get update
is an important step before installing or upgrading packages on your system because it ensures that you have the most up-to-date information about available packages.
Without updating the package index, you might not see the latest versions of software or be able to install new packages that have been added to the repositories since the last update.
Download Docker-compose binary
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Output:
The command downloads the Docker Compose binary for your specific operating system and architecture from GitHub and places it in the /usr/local/bin
directory, making it accessible system-wide.
Make it executable
sudo chmod +x /usr/local/bin/docker-compose
Output
The command sudo chmod +x /usr/local/bin/docker-compose
is making the Docker Compose binary executable.
This step is necessary because, by default, files downloaded from the internet are not executable for security reasons.
By granting execute permission, you enable the system to run the Docker Compose binary as a program when you use it in the command line.
Verify the installation
Version
docker-compose --version
Output
Through executable path
which docker-compose
Output
Test
docker-compose up
Since I did not provide any arguments after the preposition up, it should return something like this.
Done
Celebrate
You've made it!
Let's become friends
Final thoughts
I hope this article has been helpful to you. Please feel free to reach out if you have any questions. Your thoughts, suggestions, and corrections are more than welcome.
By the way, don't hesitate to drop your suggestions for new blog articles.
I look forward to seeing you next time.