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?