I have 2 Dockerfiles on my Host Machine ( Ubuntu 20.04 ). I am running docker-ce version Docker version 19.03.12, build 48a66213fe with Experimental Features enabled. I am able to build each of them with "docker buildx" for the ARM architecture and successfully run them on my embedded Linux ARM board.
Dockerfile 1:
FROM python:3.8-slim-buster
COPY git /home/git
WORKDIR /home
RUN apt-get update -y && apt-get --no-install-recommends install build-essential pkg-config libzmq5 -y && \
cd git && python3 setup.py install && apt remove --purge build-essential pkg-config -y && \
apt auto-remove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
ADD publisher.py /home/publisher.py
Dockerfile 2:
FROM python:3.8-slim-buster
COPY git /home/git
WORKDIR /home
RUN apt-get update -y && apt-get --no-install-recommends install build-essential pkg-config libzmq5 -y && \
cd git && python3 setup.py install && apt remove --purge build-essential pkg-config -y && \
apt auto-remove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
ADD subscriber.py /home/subscriber.py
Build process to create ARM compatible image on Host:
docker buildx create --name builder || true
docker buildx use builder
docker buildx build --platform linux/arm/v7 -t "company-publisher:v1.3" . --load
docker save company-publisher:v1.3 > company-publisher-v1.3.tar
Loading the image on the ARM:
docker load < ./company-publisher-v1.3.tar
The steps are same for the subsriber.
Since the images are basically the same, I wanted to change the publisher Dockerfile to the following:
FROM company-subscriber:v1.3
ADD publisher.py /home/publisher.py
Docker images shows that it is there locally:
REPOSITORY TAG IMAGE ID CREATED SIZE
company-subscriber v1.3 d2002fa18a8d 9 hours ago 121MB
But I get the error shown below - It ALWAYS tries to pull from docker.io ( which obviously does not have the image I am trying to inherit from ):
docker buildx build --platform linux/arm/v7 -t "company-publisher:v1.3" . --load
[+] Building 1.5s (5/6)
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 104B 0.0s
=> ERROR [internal] load metadata for docker.io/library/company-subscriber:v1.3 0.8s
=> [internal] load build context 0.0s
=> => transferring context: 34B 0.0s
=> ERROR [1/2] FROM docker.io/library/company-subscriber:v1.3 0.7s
=> => resolve docker.io/library/company-subscriber:v1.3 0.7s
------
> [internal] load metadata for docker.io/library/company-subscriber:v1.3:
------
------
> [1/2] FROM docker.io/library/company-subscriber:v1.3:
------
failed to solve: rpc error: code = Unknown desc = failed to load cache key: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
How can I get buildx to work with a local image?