When building a Docker image on a totally fresh new Macbook (M1 Apple chip) I get this:
$ docker build -f Dockerfile-local-dev .
[+] Building 1.4s (3/3) FINISHED
=> [internal] load build definition from Dockerfile-local-dev 0.0s
=> => transferring dockerfile: 47B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for docker.io/library/nicecorp-empty-db:latest 1.3s
------
> [internal] load metadata for docker.io/library/nicecorp-empty-db:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
Docker is installed and running. Repeating the command only results in the same error.
This apparently has something to do with pull policies and such, but it should just find a local image and use that, not try and pull it off the global Docker registry …
$ docker --version
Docker version 20.10.7, build f0df350
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
nicecorp-empty-db latest 99c3d1659d80 20 minutes ago 393MB
When doing this exact thing on the same code and Dockerfile before the Summer this worked perfectly fine, but that was on a Linux box, so could this be down to a new Docker version or some bug relating to the M1 chip?
The Dockerfile-local-dev
file:
$ cat Dockerfile-local-dev
# Most definitely not to be used in production!
FROM nicecorp-empty-db
MAINTAINER ACME <devs@ACME.com>
# Allow nicecorpadmin user to create and drop databases (used for test runs)
RUN /etc/init.d/postgresql start && \
psql --command "CREATE DATABASE nicecorpdb_test_template OWNER nicecorpadmin;" && \
psql --command "ALTER USER nicecorpadmin SUPERUSER;"
# Allow all users to connect to all databases (used for test runs to allow ad-hoc databases)
RUN echo "host all all samenet password" >> /etc/postgresql/12/main/pg_hba.conf
RUN echo "max_connections = 1000" >> /etc/postgresql/12/main/postgresql.conf