docker-compose V1 deprecation

Reading Time: 2 minutes

Last Updated: 9/23/2024

I am going to see if I can try to break this down into manageable bytes. I noticed a change when I went from ubuntu Jammy 22.04 to Nobel 24.04. After this I had to adjust a few things to get “compose” to work again. There were sings apparently.

From July 2023 Compose V1 stopped receiving updates.

This became apparent. The newer version is built mostly with GO with no python support at it’s core. So if you can do the following…

root@nodex:/home/ubuntu# pip list | grep docker
docker                5.0.3
docker-compose        1.29.2
dockerpty             0.4.1

and still see items…. I would guess that you are still running on something old. Ultimately you will want 1) Upgrade to a newer version of Docker. You will want to 2) install the docker-compose-plugin. This last part is the part that that I didn’t pick up on.

The compose plug in does exactly what you are probably thinking it does. It adds functionality to the docker command (in this instance)

root@nodex:/home/ubuntu# pip uninstall dockerpty -y
Found existing installation: dockerpty 0.4.1
Uninstalling dockerpty-0.4.1:
  Successfully uninstalled dockerpty-0.4.1

STEP 1: – Preparing for newer version of docker

The following is a sign.

root@nodex:/home/ubuntu# apt-get install docker-compose-plugin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package docker-compose-plugin

The upshot is here… That you can 1) update your list of repositories or 2) grab the DEB binary directly. For the sake of discussion we are going to update the repo list. After we have executed the lines we can do the following. You should see a new file named docker.list in the /etc/apt.sources.list.d directory. This instructs apt to look for additional resource at this location. I will most likely go back and annotate more. But for today’s purposes I am going to give you the same advice I would give myself (because that’s what I am doing) just copy the text which is designed to add a GPG key; then create the “docker.list” file.

root@nodex:/etc/apt/sources.list.d# ls -al
total 20
drwxr-xr-x 2 root root 4096 Sep 23 17:08 .
drwxr-xr-x 8 root root 4096 Sep 19 14:05 ..
-rw-r--r-- 1 root root  112 Sep 23 17:08 docker.list

Should to the trick. After the update then you can do a.

apt update

You could then test what version of compose you are using.

root@nodex:/home/ubuntu# docker compose version
Docker Compose version v2.29.7

THE UPSHOT

The upshot is that you should now be able to bring up docker images using
“docker compose up -d” (for example) Not essentially we are using the plugin to add the compose command.

I Plan on going back and revisiting this in more detail.

Reference:
https://docs.docker.com/compose/releases/migrate/
https://docs.docker.com/compose/install/linux/
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

This entry was posted in Docker. Bookmark the permalink.