moby / moby/buildkit

Buildkit does not use AWS web identity for auth, cannot push to ECR

Open
#3,947 13 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

Description

I'm running moby/buildkit:v0.11.6-rootless in Kubernetes v1.25, using AWS IRSA for IAM. The pod that runs buildkit looks like so:

    Environment:
      BUILDKITD_FLAGS:                    --oci-worker-no-process-sandbox
      AWS_STS_REGIONAL_ENDPOINTS:         regional
      AWS_DEFAULT_REGION:                 us-east-1
      AWS_REGION:                         us-east-1
      AWS_ROLE_ARN:                       arn:aws:iam::00000000:role/the-role-im-trying-to-use
      AWS_WEB_IDENTITY_TOKEN_FILE:        /var/run/secrets/eks.amazonaws.com/serviceaccount/token
    Mounts:
      /var/run/secrets/eks.amazonaws.com/serviceaccount from aws-iam-token (ro)

and other tools such as Kaniko are able to successfully push to ECR. Buildkit fails consistently with a 401 Unathorized. I have tested this by replacing the container image and the args from Buildkit to Kaniko.

Documentation suggests that this should be supported, but it is not.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the provided rootless Kubernetes setup with AWS IRSA and an ECR push, then trace BuildKit's authentication path and compare it with the documented support. Done means the supplied web-identity environment authenticates successfully and BuildKit can push to ECR.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, kubernetes
Domain
authentication, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.