BrainFrame uses docker to isolate itself from the host machine environment. Depending on what is available in the host system, “brainframe compose up” uses one of the commands below:
Docker Compose V1,
docker-compose --file /usr/local/share/brainframe/docker-compose.yml --env-file /usr/local/share/brainframe/.env up
Docker Compose V2,
docker compose --file /usr/local/share/brainframe/docker-compose.yml --env-file /usr/local/share/brainframe/.env up
The docker compose failure often is caused by the compatibility of various docker components installed on the host, e.g. docker server, CLI and compose module. Conflicting versions of the modules can cause issues in this post . Here’s how we can troubleshoot and resolve the version compatibility issues:
1 Reinstall Docker Python Packages
Uninstall Existing Packages:
pip uninstall docker docker-compose
You may need to run the uninstall command multiple times if the packages are installed in multiple locations. Then install Specific Compatible Versions:
pip install docker==6.1.3 docker-compose==1.29.2
2 Use Docker Compose V2 (Optional but Recommended)
Docker Compose V2 is now integrated as a Docker plugin and doesn’t rely on Python dependencies. Install Docker Compose V2:
sudo apt-get update
sudo apt-get install docker-compose-plugin
Verify Installation:
docker compose version
Note that the command with V2 is docker compose (space instead of hyphen).
3 Explanation of the docker & docker compose versions
Ensure that you’re using compatible versions. Observation of the compatible latest releases in Dec., 2024
Ubuntu | docker engine | docker compose | docker python SDK
18.04 & 20.04 | 24.0.7 | V1: v1.29.2 | >4.3.1,<7.0.0, 6.1.3 is the latest version
22.04 & 24.04 | 27.3.1 | V2: v2.29.7 | 6.1.3 and possibly a few older versions
3.1 docker engine versions
docker version --format '{{.Server.Version}}' # engine version
docker version --format '{{.Server.APIVersion}}' # engine API version
Noticed that docker engine installation includes docker CLI, and docker compose V2 has been integrated.
3.2 docker CLI versions
docker version --format '{{.Client.Version}}' # CLI version
docker version --format '{{.Client.APIVersion}}' # CLI API version
docker --version # CLI version
3.3 docker compose V1 version
Install docker compose V1 with the pip command below. docker-compose python package is compose V1, including docker-compose CLI tool + python API, latest known good compose V1 version 1.29.2
pip install docker-compose
Check docker compose V1 version,
docker-compose --version # compose V1 version
Or use any of below commands:
docker-compose version # Also shows version of docker-py, CPython, OpenSSL version
python3 -m compose --version
pip show docker-compose
docker python module version & docker-compose python module version
docker python module is docker SDK for python. Install docker python SDK with the command below. This module includes some compose functionality, but NOT compose up/down. You cannot execute the docker pip module directly
pip install docker
docker-compose module depends on docker SDK python module
docker-compose module is compatible with docker SDK >4.3.1,<7.0.0
docker-compose module is not compatible with docker SDK 7.0.0/7.1.0
docker SDK python module 6.1.3 is the latest version compatible with both compose V1 and V2
3.4 Docker compose V2 version
Docker compose V2 has been integrated as a docker plugin
docker compose version # compose V2 version