No description
  • Go 65.2%
  • Dockerfile 15.9%
  • Shell 12.3%
  • Makefile 6.6%
Find a file
Nick Sieger 431ccbdadf
Merge pull request #31 from markdegrootnl/patch-1
Continue if docker-compose (v1) is not installed
2022-09-20 09:18:24 -05:00
.github/workflows compose-switch is installed as a Linux "alternative" to docker-compose 2021-09-15 09:56:09 +02:00
exec Publish compose-switch as OSS component 2021-09-06 11:51:06 +02:00
internal Publish compose-switch as OSS component 2021-09-06 11:51:06 +02:00
redirect fix: panic caused by empty string argument 2022-06-24 11:28:10 -05:00
.gitignore Publish compose-switch as OSS component 2021-09-06 11:51:06 +02:00
centos-test.Dockerfile compose-switch is installed as a Linux "alternative" to docker-compose 2021-09-15 09:56:09 +02:00
go.mod compose-switch is installed as a Linux "alternative" to docker-compose 2021-09-15 09:56:09 +02:00
go.sum compose-switch is installed as a Linux "alternative" to docker-compose 2021-09-15 09:56:09 +02:00
install_on_linux.sh Merge pull request #31 from markdegrootnl/patch-1 2022-09-20 09:18:24 -05:00
LICENSE Publish compose-switch as OSS component 2021-09-06 11:51:06 +02:00
main.go compose-switch is installed as a Linux "alternative" to docker-compose 2021-09-15 09:56:09 +02:00
Makefile Makefile: Fix copy-paste mistakes in the Makefile 2021-09-29 18:50:02 +02:00
README.md Fix 2 typos in README 2022-08-16 01:50:45 +02:00
ubuntu-test.Dockerfile compose-switch is installed as a Linux "alternative" to docker-compose 2021-09-15 09:56:09 +02:00

Compose Switch

Compose Switch is a replacement to the Compose V1 docker-compose (python) executable. It translates the command line into Compose V2 docker compose then run the latter.

installation

We provide a script for automated installation:

$ curl -fL https://raw.githubusercontent.com/docker/compose-switch/master/install_on_linux.sh | sh

Manual installation

  1. download compose-switch binary for your architecture
$ curl -fL https://github.com/docker/compose-switch/releases/latest/download/docker-compose-linux-amd64 -o /usr/local/bin/compose-switch
  1. make compose-switch executable
$ chmod +x /usr/local/bin/compose-switch
  1. rename docker-compose binary if you already have it installed as /usr/local/bin/docker-compose
$ mv /usr/local/bin/docker-compose /usr/local/bin/docker-compose-v1
  1. define an "alternatives" group for docker-compose command
$ update-alternatives --install /usr/local/bin/docker-compose docker-compose <PATH_TO_DOCKER_COMPOSE_V1> 1
$ update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99

check installation

$ update-alternatives --display docker-compose
docker-compose - auto mode
  link best version is /usr/local/bin/compose-switch
  link currently points to /usr/local/bin/compose-switch
  link docker-compose is /usr/local/bin/docker-compose
/usr/bin/docker-compose - priority 1
/usr/local/bin/compose-switch - priority 99

select Compose implementation to run by docker-compose

$ update-alternatives --config docker-compose
There are 2 choices for the alternative docker-compose (providing /usr/local/bin/docker-compose).

  Selection    Path                           Priority   Status
------------------------------------------------------------
* 0            /usr/local/bin/compose-switch   99        auto mode
  1            /usr/bin/docker-compose         1         manual mode
  2            /usr/local/bin/compose-switch   99        manual mode

Press <enter> to keep the current choice[*], or type selection number: