devcontainers / templates

Repository for Dev Container Templates that are managed by Dev Container spec maintainers. See https://github.com/devcontainers/template-starter to create your own!
https://containers.dev/templates
MIT License
924 stars 242 forks source link

docker-outside-of-docker: compose and other cli-plugins #139

Closed floge07 closed 1 year ago

floge07 commented 1 year ago

The "docker-outside-of-docker" feature template works as expected and I can use the docker cli with access to the host docker.sock inside my devcontainer. But I quickly ran into the problem of the cli not knowing any "docker compose [...]" commands.

To my knowledge, all docker commands with an * are optional plugins for the cli:

host system:

Management Commands:
  builder     Manage builds
  buildx*     Docker Buildx (Docker Inc., v0.10.3)
  compose*    Docker Compose (Docker Inc., v2.15.1)
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  dev*        Docker Dev Environments (Docker Inc., v0.1.0)
  extension*  Manages Docker extensions (Docker Inc., v0.2.18)
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  sbom*       View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan*       Docker Scan (Docker Inc., v0.25.0)
  scout*      Command line tool for Docker Scout (Docker Inc., v0.6.0)
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

devcontainer:

Management Commands:
  builder     Manage builds
  buildx*     Docker Buildx (Docker Inc., v0.10.4)
  container   Manage containers
  context     Manage contexts
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  plugin      Manage plugins
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

I'm going to add a manual install for this in my devcontainer dockerfile (based on this) but is there not any easier way using this feature-template? Could a "plugins": [ "compose", ... ] option be added, or something like that?

floge07 commented 1 year ago

Uh sorry maybe this was the wrong repo... It seems I'm actually using https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker I'm confused about what "docker-outside-of-docker" in this repo is for then...