Skip to content

Instantly share code, notes, and snippets.

@piksel
Created July 8, 2021 16:45
Show Gist options
  • Save piksel/2d66c663bb9833285062fe1a573baef8 to your computer and use it in GitHub Desktop.
Save piksel/2d66c663bb9833285062fe1a573baef8 to your computer and use it in GitHub Desktop.
Change in containers created by docker compose
# Using docker subcommand `compose`
$ docker compose up
$ docker container inspect kafka -f ' Image: {{ .Image }}{{"\n"}}Config.Image: {{.Config.Image}}'
Image: sha256:d694642b6bef4693082bd6192d923f37af9e27ef15beef9de7d93a51d1a5d74d
Config.Image: sha256:d694642b6bef4693082bd6192d923f37af9e27ef15beef9de7d93a51d1a5d74d
# Using standalone `docker-compose`
$ docker-compose up
$ docker container inspect kafka -f ' Image: {{ .Image }}{{"\n"}}Config.Image: {{.Config.Image}}'
Image: sha256:d694642b6bef4693082bd6192d923f37af9e27ef15beef9de7d93a51d1a5d74d
Config.Image: bitnami/kafka:latest
@piksel
Copy link
Author

piksel commented Jul 8, 2021

Okay, finally got it working after finding the last paragraph in the docker/compose-cli README

So, the v1.* releases does not include docker compose. So... what are they? Go-versions of docker-compose? Nope, they are patched versions of the Docker CLI, adding another version field labeled Cloud integration...

$ ./docker-linux-amd64 version
Client: Docker Engine - Community
 Cloud integration: 1.0.17

But okay, downloading the latest pre-release v2.0.0-beta.6 and moving it into the cli-plugins folder:

$ curl -L -o ~/.docker/cli-plugins/docker-compose --create-dirs \
  'https://github.com/docker/compose-cli/releases/download/v2.0.0-beta.6/docker-compose-linux-amd64'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   634  100   634    0     0   3062      0 --:--:-- --:--:-- --:--:--  3062
100 24.2M  100 24.2M    0     0  17.5M      0  0:00:01  0:00:01 --:--:-- 27.6M

$ docker compose

Usage:  docker compose [OPTIONS] COMMAND
...

Finally!

$ docker compose up -d
[+] Running 1/1
 ⠿ Container dc-test_web_1  Started

$ docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED          STATUS          PORTS                                       NAMES
fb0c2a735c38   4cdc5dd7eaad      "/docker-entrypoint.…"   18 minutes ago   Up 20 seconds   80/tcp                                      dc-test_web_1

No image tag, only ID. Well, at least it's consistent...

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