The docker.io apt package doesn't ship the compose plugin, and the npm docker-compose package is an unrelated legacy tool that doesn't provide the 'docker compose' CLI subcommand. Install the official compose v2 binary as a docker CLI plugin instead.
15 lines
631 B
Docker
15 lines
631 B
Docker
FROM node:22-bullseye
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y docker.io curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN corepack enable
|
|
|
|
# Install Docker Compose V2 as a CLI plugin (docker.io package does not
|
|
# include it, and the npm "docker-compose" package is an unrelated
|
|
# legacy wrapper that does not provide the `docker compose` subcommand).
|
|
RUN mkdir -p /usr/libexec/docker/cli-plugins \
|
|
&& curl -SL "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64" \
|
|
-o /usr/libexec/docker/cli-plugins/docker-compose \
|
|
&& chmod +x /usr/libexec/docker/cli-plugins/docker-compose |