# Docker-compose plugin fails to push

**URL:** <https://forum.buildkite.community/t/docker-compose-plugin-fails-to-push/3274>\
**Category:** Docker\
**Created:** [September 29, 2023, 11:31am UTC](https://forum.buildkite.community/t/docker-compose-plugin-fails-to-push/3274 "2023-09-29T11:31:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matbaker](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@matbaker](https://forum.buildkite.community/u/matbaker)\
**Post date:** [September 29, 2023, 11:31am UTC](https://forum.buildkite.community/t/docker-compose-plugin-fails-to-push/3274/1 "2023-09-29T11:31:54Z")

</div>

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

```auto
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:

```auto
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](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin#pushing-tagged-images)) I’d expect this to build my `app` service image and push it to my ECR repository. However, it fails as follows:

```auto
: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?

---

<div class="post-metadata">

**Author:** ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)\
**Post date:** [September 29, 2023, 6:21pm UTC](https://forum.buildkite.community/t/docker-compose-plugin-fails-to-push/3274/2 "2023-09-29T18:21:59Z")

</div>

👋🏻 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](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin#cli-version-optional-string-or-integer)

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

---

<div class="post-metadata">

**Author:** ![matbaker](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@matbaker](https://forum.buildkite.community/u/matbaker)\
**Post date:** [September 29, 2023, 10:23pm UTC](https://forum.buildkite.community/t/docker-compose-plugin-fails-to-push/3274/3 "2023-09-29T22:23:39Z")

</div>

> [@matbaker](#):
>
> ```auto
> 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
> 
> ```

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/system/32/1321_2.png) [@system](https://forum.buildkite.community/u/system)\
**Post date:** [September 30, 2023, 10:23pm UTC](https://forum.buildkite.community/t/docker-compose-plugin-fails-to-push/3274/4 "2023-09-30T22:23:51Z")

</div>

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