I get this error when building a Dockerfile with Buildx on my Mac Mini. The amd64 and arm64 images are built without a problem.
The Dockerfile looks like this:
# syntax = docker/dockerfile:experimental
FROM library/node:lts-bullseye as ui-builder
WORKDIR /app
COPY ./ui/ ./
RUN npm install && npm run build
FROM rust:latest as dependency-cache
USER root
WORKDIR /app/src
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN rustc --version
ADD Cargo.toml .
ADD dummy.rs ./src/main.rs
ADD build.rs .
RUN cargo update
RUN RUSTFLAGS='-C target-feature=-crt-static' cargo build --release
FROM rust:latest as builder
USER root
WORKDIR /app/src
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
COPY --from=dependency-cache /usr/local/cargo /usr/local/cargo
COPY --from=dependency-cache /app/src/target/ /app/src/target/
RUN rm -rf /app/src/static/*||true
COPY --from=ui-builder /app/dist /app/src/static
RUN rm -rf /app/src/target/release/deps/podfetch*
RUN rm -rf /app/src/target/release/podfetch*
ADD Cargo.toml .
ADD static ./static
ADD migrations ./migrations
ADD src ./src
ADD build.rs .
ADD db ./db
RUN cargo update
RUN --security=insecure mkdir -p /usr/local/cargo/registry/index && \
chmod 777 /usr/local/cargo/registry/index && \
mount -t tmpfs none /usr/local/cargo/registry/index && \
RUSTFLAGS='-C target-feature=-crt-static' cargo build --release
FROM library/alpine:3.17 AS Runtime
WORKDIR /app/
RUN apk add libgcc tzdata
ENV TZ=Europe/Berlin
COPY --from=builder /app/src/target/release/podfetch /app/podfetch
COPY --from=builder /app/src/migrations /app/migrations
COPY --from=builder /app/src/db /app/db
COPY --from=ui-builder /app/dist /app/static
COPY ./docs/default.jpg /app/static/default.jpg
EXPOSE 8000
CMD ["./podfetch"]
If you want to reproduce the issue:
- git clone https://github.com/SamTV12345/PodFetch.git
- git checkout origin 109-readd-armv7-support
- docker buildx build --allow security.insecure --platform linux/arm/v7 --pull --push -f Dockerfile_armv7 -m 4g -t samuel19982/podfetch:devarmv7 .
The full error log is this:
> [dependency-cache 7/8] RUN cargo update:
#24 0.470 Updating crates.io index
#24 46.84 From https://github.com/rust-lang/crates.io-index
#24 46.84 * [new ref] -> origin/HEAD
#24 46.92 error: no matching package named `actix` found
#24 46.92 location searched: registry `crates-io`
#24 46.92 required by package `podfetch v0.1.0 (/app/src)`