-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugin on COS (Computer-Optimized OS) #10463
Comments
Nevermind, I found a solution that works for any CLI plugin (if any other) thanks to symlinks, and that is stateful - Run this once only, and you can then run compose with 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.17.2/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 Works like a charm and better in my mind than using DIND |
Awesome, I'm glad you got this working! |
I'd suggest to not store The writable and executable mounts are:
the official installation instructions Alternatively one can use the
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
alias docker-compose='docker run --rm docker compose'
Using a function:
docker() {
if [ "$1" = compose ]; then
command docker run --rm docker "$@"
else
command docker "$@"
fi
}
export -f docker $ docker compose version Using a script:
#!/bin/sh -eu
if [ "$1" = compose ]; then
/usr/bin/docker run --rm docker "$@"
else
/usr/bin/docker "$@"
fi
export PATH=/var/lib/google/bin:$PATH
|
Description
https://docs.docker.com/compose/install/linux/#install-the-plugin-manually does not work as-is for locked down file-system like COS (https://cloud.google.com/container-optimized-os/docs/concepts/disks-and-filesystem).
Background: COS is very restricted (for a reason) so one can't install using a package manager and most mounts are
noexec
.One workaround is to sudo mount a new dir in
/mnt/disks
e.g./mnt/disks/docker
, curl the standalone compose there, change permission (executable, all users).All good and
docker-compose
works (COS has the docker engine/CLI).However, it would be good if it could integrate as intended with the CLI. To do so, a new env var must exist in my mind telling the CLI where to look for cli-plugins instead of (or in addition to)
$DOCKER_CONFIG/cli_plugins
.Also, does
docker-compose
exists as python script ? COS has Python (3.8) installed and sopython docker-compose.py
would not require the hacks.The text was updated successfully, but these errors were encountered: