Just a quick fun experiment to try to make docker-compose
work as a Docker CLI plugin
- docker/cli#1534 CLI Plugins Design
- docker/cli#1564 Basic framework for writing and running CLI plugins
To use it (assuming you have docker compose installed):
-
download a and install nightly build of the docker cli (linux macOS)
-
create the plugins directory
mkdir -p ~/.docker/cli-plugins
-
download the "plugin", and save it as
~/.docker/cli-plugins/docker-compose
(note: no.sh
extension!)curl https://gist.githubusercontent.com/thaJeztah/b7950186212a49e91a806689e66b317d/raw/36d4c5854523502deed5b56842b0d34cd6ec0f70/docker-compose-plugin.sh > ~/.docker/cli-plugins/docker-compose
-
make it executable
chmod +x ~/.docker/cli-plugins/docker-compose
-
run the
help
command on the nightly docker cli to verify the plugin was installed./docker help ... Commands: build Build an image from a Dockerfile compose (Docker) Define and run multi-container applications login Log in to a Docker registry logout Log out from a Docker registry
-
enjoy!
./docker compose help Define and run multi-container applications with Docker. Usage: docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...] docker-compose -h|--help Options: -f, --file FILE Specify an alternate compose file (default: docker-compose.yml) -p, --project-name NAME Specify an alternate project name
Nice concept!