5

I'd like to use one experimental feature of Docker BuidlKit (mount=type=cache)

The first lines of my Dockerfile are:

    # syntax=docker/dockerfile:experimental
    FROM i386/debian:buster

    #
    # Setup an apt cache for Docker (experimental)
    #
    RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
    RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt apt update && apt-get --no-install-recommends install -y gcc

I have setup a Password Store for docker, logged in successfully to docker hub, "docker-credential-pass" binary in my PATH, setup the "docker login process using the encrypted password". (as described in

"How to Enable Docker Experimental Features and Encrypt Your Login Credentials"

    kalou@shinwey $ pass list
    Password Store
    `-- docker-credential-helpers
        |-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        |   `-- berryamin
        `-- docker-pass-initialized-check

But when I launch the image build, the process fails:


    DOCKER_BUILDKIT=1 docker build -t minexpert2:0.1 .
    [+] Building 0.5s (3/3) FINISHED
     => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                        0.1s
     => => transferring dockerfile: 38B                                                                                                                                                                                                                                                       0.0s
     => [internal] load .dockerignore                                                                                                                                                                                                                                                     0.1s
     => => transferring context: 2B                                                                                                                                                                                                                                                       0.0s
     => ERROR resolve image config for docker.io/docker/dockerfile:experimental                                                                                                                                                                                                           0.4s
    ------
     > resolve image config for docker.io/docker/dockerfile:experimental:
    ------
    failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc     error: code = Unknown desc = error getting credentials - err: exit status 1, out: `exit status 2: gpg: decryption failed: No secret key`

May someone help to explain what's missing here?

cconsta1
  • 737
  • 1
  • 6
  • 20
kalou.net
  • 446
  • 1
  • 4
  • 16
  • Maybe similar to https://stackoverflow.com/questions/28321712/gpg-decryption-fails-with-no-secret-key-error – kalou.net Apr 19 '20 at 08:08
  • More investigation gives in log: Apr 19 19:52:00 shinwey dockerd[4960]: time="2020-04-19T19:52:00.208583620+02:00" level=warning msg="grpc: addrConn.createTransport failed to connect to { 0 }. Err :connection error: desc = \"transport: Error while dialing only one connection allowed\". Reconnecting..." module=grpc – kalou.net Apr 19 '20 at 17:52
  • 1
    might be related to "buildkit: Build fails when FROM image isn't cached" https://github.com/moby/buildkit/issues/1271 – kalou.net Apr 27 '20 at 13:15

1 Answers1

0

try download first the docker image and run command for build image, it worked me

paulspartan14
  • 81
  • 1
  • 1