makisu icon indicating copy to clipboard operation
makisu copied to clipboard

Build docker-credential-ecr-login / docker-credential-gcd helpers using Makefile

Open salizzar opened this issue 6 years ago • 1 comments

Hey there,

I'm trying to use makisu locally without building via Dockerfile on the repository root but docker-credential helpers are not available, causing this error:

$ makisu build --registry-config=$HOME/Temp/makisu/makisu.yml --tag helloworld/nginx:v1.0.0 --push 123456789012.dkr.ecr.us-east-1.amazonaws.com ~/Temp/makisu/
{"level":"info","ts":1550802244.112093,"msg":"Starting Makisu build (version=master-unreleased)"}
{"level":"info","ts":1550802244.119508,"msg":"Using build context: /Users/marcelopinheiro/Temp/makisu"}
{"level":"info","ts":1550802244.119945,"msg":"Using local file at /tmp/makisu-storage/cache_key_value.json for cacheID storage"}
{"level":"error","ts":1550802244.120144,"msg":"Failed to fetch intermediate layer with cache ID ee8ad9d1: find layer ee8ad9d1: layer not found in cache"}
{"level":"info","ts":1550802244.1201558,"msg":"* Stage 1/1 : (alias=0,latestfetched=-1)"}
{"level":"info","ts":1550802244.120167,"msg":"* Step 1/2 (commit) : FROM nginx:latest  (cb8a01af)"}
{"level":"info","ts":1550802244.120221,"msg":"* Started pulling image index.docker.io/library/nginx:latest"}
{"level":"info","ts":1550802244.120234,"msg":"Client TLS is disabled"}
{"level":"info","ts":1550802246.0522811,"msg":"* Skipped pulling existing layer library/nginx:sha256:6ae821421a7debccb4151f7a50dc8ec0317674429bec0f275402d697047a8e96"}
{"level":"info","ts":1550802246.05234,"msg":"* Skipped pulling existing layer library/nginx:sha256:eb2aec2b9c9fe686593403563093e3a62d7dafbfca34432d3cc959a1a2bfe99e"}
{"level":"info","ts":1550802246.0524049,"msg":"* Skipped pulling existing layer library/nginx:sha256:f09fe80eb0e75e97b04b9dfb065ac3fda37a8fac0161f42fca1e6fe4d0977c80"}
{"level":"info","ts":1550802246.052384,"msg":"* Skipped pulling existing layer library/nginx:sha256:da4474e5966c437b2665bb15c441d76b63a49c06f48d381c3983f3d6c811675e"}
{"level":"info","ts":1550802246.052491,"msg":"* Finished pulling image index.docker.io/library/nginx:latest in 1.932317319s"}
{"level":"info","ts":1550802246.053896,"msg":"* Processing FROM layer 6ae821421a7debccb4151f7a50dc8ec0317674429bec0f275402d697047a8e96"}
{"level":"info","ts":1550802246.590184,"msg":"* Merged 4558 headers from tar to memfs"}
{"level":"info","ts":1550802246.592138,"msg":"* Processing FROM layer da4474e5966c437b2665bb15c441d76b63a49c06f48d381c3983f3d6c811675e"}
{"level":"info","ts":1550802247.033928,"msg":"* Merged 781 headers from tar to memfs"}
{"level":"info","ts":1550802247.0352159,"msg":"* Processing FROM layer eb2aec2b9c9fe686593403563093e3a62d7dafbfca34432d3cc959a1a2bfe99e"}
{"level":"info","ts":1550802247.035655,"msg":"* Merged 5 headers from tar to memfs"}
{"level":"info","ts":1550802247.0356941,"msg":"* Execute FROM nginx:latest  (cb8a01af) took 2.915652391s"}
{"level":"info","ts":1550802247.037396,"msg":"* Step 2/2 (commit) : COPY index.html /usr/share/nginx/html  (ee8ad9d1)"}
{"level":"info","ts":1550802247.0374799,"msg":"* Execute COPY index.html /usr/share/nginx/html  (ee8ad9d1) took 22.939µs"}
{"level":"info","ts":1550802248.043388,"msg":"* Created copy layer with 4 files"}
{"level":"info","ts":1550802248.045254,"msg":"* Committed gzipped layer sha256:0251654461d411e9e839af63c067e53dab596316f151aab95f1f654334fe684f (245 bytes)"}
{"level":"info","ts":1550802248.045299,"msg":"* Pushing with cache ID ee8ad9d1"}
{"level":"info","ts":1550802248.045441,"msg":"Client TLS is disabled"}
{"level":"error","ts":1550802248.0506968,"msg":"Failed to push cache: push layer sha256:0251654461d411e9e839af63c067e53dab596316f151aab95f1f654334fe684f: check layer exists: 123456789012.dkr.ecr.us-east-1.amazonaws.com/helloworld/nginx (sha256:0251654461d411e9e839af63c067e53dab596316f151aab95f1f654334fe684f): get security opt: get credentials: get credentials from helper ecr-login: error getting credentials - err: fork/exec /makisu-internal/docker-credential-ecr-login: no such file or directory, out: ``"}
{"level":"info","ts":1550802248.052174,"msg":"Computed total image size 44730604","total_image_size":44730604}
{"level":"info","ts":1550802248.052207,"msg":"Successfully built image helloworld/nginx:v1.0.0"}
{"level":"info","ts":1550802248.052316,"msg":"* Started pushing image 123456789012.dkr.ecr.us-east-1.amazonaws.com/helloworld/nginx:v1.0.0"}
{"level":"info","ts":1550802248.052325,"msg":"Client TLS is disabled"}
{"level":"error","ts":1550802248.055394,"msg":"failed to push image: failed to push image: check manifest exists for image 123456789012.dkr.ecr.us-east-1.amazonaws.com/helloworld/nginx:v1.0.0: get security opt: get credentials: get credentials from helper ecr-login: error getting credentials - err: fork/exec /makisu-internal/docker-credential-ecr-login: no such file or directory, out: ``"}

Below makisu.yml content:

index.docker.io:
  .*:
    security:
      tls:
        client:
          disabled: true
      basic:
        username: ""
        password: ""

"123456789012.dkr.ecr.us-east-1.amazonaws.com":
  .*:
    security:
      tls:
        client:
          disabled: true
      credsStore: ecr-login

My Dockerfile:

FROM nginx:latest

COPY index.html /usr/share/nginx/html

The index.html:

<html><body>Hello World!</body></html>

After a little search, I notice path /makisu-internal is hardcoded. I'm not sure but I believe this path may impact in case of Makisu be called in "standalone" way (not dockerized).

I'm not sure if this change is trivial, still reading the codebase. There is a quick workaround to fix it?

salizzar avatar Feb 22 '19 02:02 salizzar

This might be fixed by the fact that makisu uses the libraries for ECR and GCR now.

Rowern avatar Jul 15 '19 15:07 Rowern