Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx reports success on Kaniko failure after credentials check #953

Open
tomaszkrzyzanowski opened this issue Jan 29, 2024 · 0 comments
Open

Comments

@tomaszkrzyzanowski
Copy link

While working on implementing nx-container on Bitbucket Pipelines with Kaniko engine (as it's only engine able to work in BB)

I discovered that when Kaniko will not find the right pair of credentials and fails the whole build, nx-container don't see any issue and reports success

Kaniko executor response while running manually from nx-kaniko image:

/workspace # executor --context /workspace --destination example/image:latest
error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "example/image:latest": POST https://index.docker.io/v2/example/image/blobs/uploads/: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:example/image Type:repository] map[Action:push Class: Name:example/image Type:repository]]
/workspace # echo $?
1
/workspace #

In CI last few lines of the successful build are:

>  Bake definition file 
{
  "target": {
    "container-metadata-action": {
      "tags": [
        "example/image:kaniko",
        "example/image:sha-34a567f"
      ],
      "labels": {
        (REDACTED)
      },
      "args": {
        "DOCKER_META_IMAGES": "example/image",
        "DOCKER_META_VERSION": "kaniko"
      }
    }
  }
}
[command]/kaniko/executor --dockerfile /opt/atlassian/pipelines/agent/build/apps/example/Dockerfile --label (REDACTED)--destination example/image:kaniko --destination example/image:sha-34a567f --cache=true --use-new-run --context=.
error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "example/image:kaniko": POST https://index.docker.io/v2/library/example/blobs/uploads/: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name: example/image Type:repository] map[Action:push Class: Name:example/image Type:repository]]
>  Removing temp folder /tmp/docker-build-push-NBJbdk 
 
 >  NX   Successfully ran target build-docker for 2 projects and 3 tasks they depend on

to build the images, I have used command
npx nx affected --target=build-docker --base="origin/main" --head=HEAD --configuration=production --parallel=1

Packages versions:

  "@nx-tools/container-metadata": "^5.1.0",
  "@nx-tools/nx-container": "^5.1.0",

nx-kaniko image version:
gperdomor/nx-kaniko:18.12.0-alpine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant