Score:1

Installing docker/compose-bin plugin on Google's Container Optimized OS

mx flag

I am trying install the docker/compose-bin plugin on a Google Cloud VM with Container Optimized OS (https://hub.docker.com/r/docker/compose-bin/tags).

Has anybody achieved this?

I understand docker is running as a container and I think I have to install the plugin binary in the respective plugins folder inside the container. Am I in the right direction?

I am able to use the old docker-compose (https://hub.docker.com/r/docker/compose/tags) in a container using this script and alias:

#!/bin/bash
VERSION=${1:-1.27.4}

echo "* Add an alias for docker-compose to the shell configuration file ..."
echo alias docker-compose="'"'docker run --rm \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v "$PWD:$PWD" \
    -w="$PWD" \
    docker/compose:'"${VERSION}"''"'" >> ~/.bashrc

echo "* Pull container image for docker-compose ..."
docker pull docker/compose:${VERSION}

echo "* Done"
echo "* To use docker-compose, run 'source ~/.bashrc' or simply re-login"

taken from https://gist.github.com/kurokobo/25e41503eb060fee8d8bec1dd859eff3

But I would really like to use the new plugin.

John Hanley avatar
cn flag
What is the problem you are trying to solve? `Has anybody achieved this?` is not a problem statement.
supercoco avatar
mx flag
I am trying to install the docker/compose-bin plugin on a Google Cloud VM with Container Optimized OS. Don't know how to do it.
Murali Sankarbanda avatar
ws flag
Hi @supercoco, the documents listed below may be of assistance 1) https://gist.github.com/kurokobo/25e41503eb060fee8d8bec1dd859eff3 2) https://medium.com/@kyle.powers103/installing-docker-on-gcloud-vms-1479dd9dde30
Score:2
mx flag

OK I was not in the right track. Docker compose is not a server plugin but a client plugin. So you just need it on your ~/.docker.

In COS (Container Optimized OS) the /var/lib/docker directory is writable and persistent so you can save the binaries there and create a symbolic link for every user that wants to use it.

These are the instructions that worked flawlessly:

DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
CLI_PLUGINS=/var/lib/docker/cli-plugins
mkdir -p $DOCKER_CONFIG
sudo mkdir -p $CLI_PLUGINS
sudo curl -SL https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-linux-x86_64 -o $CLI_PLUGINS/docker-compose
sudo chmod -R 755 /var/lib/docker
ln -s $CLI_PLUGINS $DOCKER_CONFIG/cli-plugins 

Thanks to https://github.com/docker/compose/issues/10463

Other users on the same machine would have to run:

DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
CLI_PLUGINS=/var/lib/docker/cli-plugins
mkdir -p $DOCKER_CONFIG
ln -s $CLI_PLUGINS $DOCKER_CONFIG/cli-plugins 
supercoco avatar
mx flag
almost flawlessly, this permission change won't persist ```sudo chmod -R 755 /var/lib/docker``` so you will have to add it to a cloud_init script or add specific users to a group in order to be able have permission to execute the binary file
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.