Skip to content

Instantly share code, notes, and snippets.

@palazzem
Created January 12, 2025 10:44
Show Gist options
  • Save palazzem/c9fefab3e59eacc7b1e31bf547b3fb40 to your computer and use it in GitHub Desktop.
Save palazzem/c9fefab3e59eacc7b1e31bf547b3fb40 to your computer and use it in GitHub Desktop.
Install `docker compose` plugin on Google Container-Optimized OS
#!/bin/bash
VERSION="2.32.2"
# Install Docker Compose plugin in `/var/lib/google` (writable and stateful folder)
sudo curl -sSL https://github.com/docker/compose/releases/download/v$VERSION/docker-compose-linux-x86_64 -o /var/lib/google/docker-compose
sudo chmod o+x /var/lib/google/docker-compose
# Create symlink to install Docker Compose plugin
mkdir -p ~/.docker/cli-plugins
ln -sf /var/lib/google/docker-compose ~/.docker/cli-plugins/docker-compose
@palazzem
Copy link
Author

Credit: https://serverfault.com/a/1149540

The writable and executable mounts are:

  • /var/lib/{google,docker,toolbox} (stateful)
  • /var/lib/cloud (stateless, tmpfs, 2 MB)
  • /mnt/disks (stateless, tmpfs, 256 KB)

/var/lib/{google,docker,toolbox} are the best options, and /var/lib/google is probably better than /var/lib/docker because we have to set o+x (I suppose /var/lib/docker lacks o+x for a reason).

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