aws-ecr-orb icon indicating copy to clipboard operation
aws-ecr-orb copied to clipboard

'context "builder" already exists' error has occurred

Open bouzuya opened this issue 2 years ago • 1 comments

Orb version

8.1.2

What happened

# ...
jobs:
  build-and-push-image:
    executor: ecr-deploy
    steps:
      - setup_remote_docker
      - aws-ecr/build-and-push-image:
          repo: "repo1"
          tag: "${CIRCLE_SHA1}"
      - aws-ecr/build-and-push-image:
          path: "./path2"
          repo: "repo2"
          tag: "${CIRCLE_SHA1}"

context "builder" already exists error has occurred.

Expected behavior

Please stop calling docker context create builder multiple times. I would like to be able to specify CONTEXT (default: builder) . I use splitting jobs as a workaround.

bouzuya avatar May 13 '22 02:05 bouzuya

I also encountered this problem.

My yet another workaround is below:

jobs:
  build-and-push-image:
    executor: ecr-deploy
    steps:
      - setup_remote_docker
      - aws-ecr/build-and-push-image:
          repo: "repo1"
          tag: "${CIRCLE_SHA1}"
      - run:
          name: remove existing Docker context
          command: docker context rm -f builder
      - aws-ecr/build-and-push-image:
          path: "./path2"
          repo: "repo2"
          tag: "${CIRCLE_SHA1}"

aereal avatar Jul 05 '22 09:07 aereal

Hey @aereal and @bouzuya,

This issue has been addressed in PR #234 . There's a check that will not create the builder context if it already exists.

Thanks for contributing!

Best, Brian

brivu avatar Nov 07 '22 18:11 brivu