[READ-ONLY] Mirror of https://github.com/FoxxMD/docker-proxy-filter. Filter the contents of Docker API responses
docker docker-socket-proxy filter
0

Configure Feed

Select the types of activity you want to include in your feed.

feat(docker): Optimize build for cross-compilation and caching deps

FoxxMD (Oct 8, 2025, 1:55 PM EDT) 9651e01d e329b9a1

+23 -6
+3 -2
.dockerignore
··· 1 1 /target/ 2 - Cargo.lock 3 2 .env 4 3 .git 5 - docker/ 4 + docker/ 5 + .devcontainer/ 6 + .vscode/
+20 -4
docker/Dockerfile
··· 2 2 3 3 ENV RUST_LOG=info,docker_proxy_filter=debug 4 4 5 - WORKDIR /usr/src/app 6 - COPY . . 5 + WORKDIR /app 7 6 7 + RUN cargo init 8 8 9 - RUN cargo install --target x86_64-unknown-linux-gnu --path . 9 + COPY Cargo.lock Cargo.toml ./ 10 + 11 + # build dummy project with dependencies to get them compiled and cached 12 + RUN cargo build --release --target $(rustc --print host-tuple) 13 + 14 + # copy full app code 15 + COPY src/ src/ 16 + # updated modified timestamp so build runs again 17 + RUN touch src/main.rs 18 + 19 + # build full app to host arch and copy to generic location 20 + RUN export ARCH=$(rustc --print host-tuple); \ 21 + cargo build --release --target $ARCH \ 22 + && mkdir build \ 23 + && cp target/$ARCH/release/docker-proxy-filter build/docker-proxy-filter 10 24 11 25 FROM debian:bookworm-slim 26 + # need ssl for web server 12 27 RUN apt-get update && apt-get upgrade -y && apt-get install openssl -y && apt clean && rm -rf /var/lib/apt/lists/* 13 - COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-gnu/release/docker-proxy-filter /usr/local/bin/docker-proxy-filter 28 + # copy built app from generic location 29 + COPY --from=builder /app/build/docker-proxy-filter /usr/local/bin/docker-proxy-filter 14 30 CMD ["docker-proxy-filter"]