Docker-compose plugin fails to push

I have a very simple Buildkite pipeline using the docker-compose plugin as follows:

steps:
  - label: ":docker: Push to :ecr: repository"
    plugins:
      - docker-compose#v4.14.0:
          push:
          - app:123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/my-server:latest
    agents:
      queue: build

with a docker-compose file as follows:

version: '3.7'
services:
  app:
    build:
      context: .

As per the documentation (GitHub - buildkite-plugins/docker-compose-buildkite-plugin: 🐳⚡️ Run build scripts, and build + push images, w/ Docker Compose) I’d expect this to build my app service image and push it to my ECR repository. However, it fails as follows:

:docker: Building app
$ docker-compose -f docker-compose.yml -p buildkite018ae08d68e240deadb0d5fa55338b59 build app
...

:docker: Pushing image 123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/my-server:latest
$ docker tag buildkite018ae08d68e240deadb0d5fa55338b59_app 123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/my-server:latest
Error response from daemon: No such image: buildkite018ae08d68e240deadb0d5fa55338b59_app:latest
🚨 Error: The command exited with status 1

As can be seen the image is being built minus the _app suffix buildkite018ae08d68e240deadb0d5fa55338b59 but the push attempt is trying to push buildkite018ae08d68e240deadb0d5fa55338b59_app.

What am I missing here?

:wave:t2: It seems the issue is that is using docker-compose v1. You will need to enable the option of cli-version from the docker compose plugin and set it to 2: GitHub - buildkite-plugins/docker-compose-buildkite-plugin: 🐳⚡️ Run build scripts, and build + push images, w/ Docker Compose

We’ll update the default behavior in the plugin by the end of the year so it will use v2 by default.

Thanks @paula explicitly setting the cli-version as you have recommended does indeed address the issue:

steps:
  - label: ":docker: Push to :ecr: repository"
    plugins:
      - docker-compose#v4.14.0:
          push:
          - app:123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/my-server:latest
          cli-version: 2
    agents:
      queue: build
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.