Docker

How to Upgrade Docker Compose on Mac

Docker Compose is an open-source and effective tool that helps you create, deploy, and manage Docker applications. It is an effective choice for developers who want to build and deploy containerized applications. If you are using Docker Compose on Mac, you may need to upgrade it from time to time to take advantage of new features and bug fixes.

Read this guide to upgrade Docker Compose on Mac.

How to Upgrade Docker Compose on Mac

To upgrade the Docker compose to latest version, you can use the widely used Homebrew package manager on your Mac system. The Homebrew package manager includes the latest version of packages, and it will replace the previous Docker compose version quite easily.

To upgrade Docker compose on Mac, you can follow the below-given steps:

Step 1: Install Homebrew package manager on Mac from here.

Step 2: Then run the command given below to install the latest version of Docker compose on Mac:

brew install docker-compose

At the execution of the above command, you will see that the Homebrew package manager will continue the installation of Docker compose even if the previous version is already installed (see the above image).

Step 2: After completing the Docker compose installation, you must create a symbolic link between the Docker compose binary installed by Homebrew and the /usr/local/bin/docker-compose binary. This means that you can run docker-compose from anywhere on your system without having to specify the full path to the binary.

For creating the symbolic link for Docker compose on Mac, you can use the following command:

brew link docker-compose

Step 3: Once the symbolic link is created, use the version command to confirm Docker compose is successfully upgraded on your Mac system.

docker-compose version

Note: You can also install the latest version of Docker Desktop App that includes the upgraded version of Docker compose. This way you don’t need to run commands instead you can use the upgraded version of Docker compose directly on your Mac system.

Conclusion

Docker compose is an effective tool that helps you create, deploy, and manage Docker applications. You can easily upgrade Docker compose on Mac by installing its latest version from the Homebrew package manager. Homebrew will install Docker compose on your existing installation. You can then create a symbolic link between the Docker compose binary installed by Homebrew and the /usr/local/bin/docker-compose binary. Once done, you can then confirm the updated version of Docker compose from the version command.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.