Skip to content

Updated Docker Compose (docker-update branch)#44

Open
alxcost wants to merge 4 commits intosfu-ireceptor:docker-updatefrom
alxcost:production-v4
Open

Updated Docker Compose (docker-update branch)#44
alxcost wants to merge 4 commits intosfu-ireceptor:docker-updatefrom
alxcost:production-v4

Conversation

@alxcost
Copy link

@alxcost alxcost commented Aug 1, 2024

Hello folks,

This is a continuation of #43, but this time to the docker-update branch.

I've also updated the step for installing Docker Compose, which seems to be a bit tricky...

The new Docker Compose plugin can be in FIVE different directories, quoting from their README:

You can download Docker Compose binaries from the release page on this repository.
Rename the relevant binary for your OS to docker-compose and copy it to $HOME/.docker/cli-plugins
Or copy it into one of these folders to install it system-wide:
/usr/local/lib/docker/cli-plugins OR /usr/local/libexec/docker/cli-plugins
/usr/lib/docker/cli-plugins OR /usr/libexec/docker/cli-plugins
From: https://github.com/docker/compose

Which makes this a bit harder than it should.
So I ended up adding a little section to install_turnkey.sh that checks which of these possible directories exists, and install Docker Compose there. If none of the directories are found, it fallbacks to the user's home directory.

compose_dir=""

# Check where Docker Compose could be installed
for dir in \
        "/usr/lib/docker/cli-plugins"\
        "/usr/local/lib/docker/cli-plugins" \
        "/usr/local/libexec/docker/cli-plugins" \
        "/usr/libexec/docker/cli-plugins"
do
    echo "Checking if Docker Compose can be installed on $dir"
    if [ -d "$dir" ]; then
        echo "Docker compose can be installed on $dir"
        compose_dir=$dir
        break
    fi
done

# Fallback to user's home directory
if [ -z "$compose_dir" ]; then
    compose_dir=$HOME/.docker/cli-plugins
    echo "System-wide directory for Docker CLI plugins was not found. Defaulting to home directory at $compose_dir"
fi

sudo curl -L https://github.com/docker/compose/releases/download/2.29.1/docker-compose-`uname -s`-`uname -m` -o $compose_dir/docker-compose > /dev/null 2>&1
sudo chmod +x $compose_dir/docker-compose
echo "Done"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant