From 3dac893cc1aba24aaaa600efee13523107c6aa2b Mon Sep 17 00:00:00 2001 From: cry-inc Date: Thu, 2 Jan 2025 20:28:12 +0100 Subject: [PATCH] Generalized Dockerfile to allow ARM builds --- Dockerfile | 7 ++++--- README.md | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f3ea58e..eb5cad3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,12 +15,13 @@ WORKDIR /usr/src COPY . . # Build Rust binary -RUN cargo build --target x86_64-unknown-linux-musl --release +ENV CARGO_TARGET_DIR=/usr/src/target +RUN cargo build --release # Remove debug symboles -RUN strip /usr/src/target/x86_64-unknown-linux-musl/release/dmarc-report-viewer +RUN strip /usr/src/target/release/dmarc-report-viewer # Build final minimal image with only the binary FROM scratch -COPY --from=builder /usr/src/target/x86_64-unknown-linux-musl/release/dmarc-report-viewer / +COPY --from=builder /usr/src/target/release/dmarc-report-viewer / CMD ["./dmarc-report-viewer"] diff --git a/README.md b/README.md index 5ce2e71..cc86752 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ The latest version is automatically published as Docker image in the GitHub cont You can download the image using the command `sudo docker pull ghcr.io/cry-inc/dmarc-report-viewer`. ### Available Docker Tags -The followng tags are available aside from the versioned tag for all individual releases: +The following tags are available (aside from the versioned tag for all individual releases): * `latest` (Latest stable release) * `develop` (Last build from master branch) @@ -104,7 +104,11 @@ You should also persist the certificate caching directory on your host file syst 5. Use the help argument to list all possible configuration parameters: `dmarc-report-viewer --help` ### Docker Builds (Linux only) -Use the command `docker build . --pull --tag dmarc-report-viewer` to build the tiny Docker image. +The Dockerfile works for X86-64 and AArch64 (Raspberry Pi & Apple Silicon) architectures. +1. Install Docker +2. Check out this repository (or download and extract the ZIP file) +3. Run the command `sudo docker build . --pull --tag dmarc-report-viewer` in the folder with this README file +4. You should now be able to see the new Docker image using the command `sudo docker images` ## Acknowledgments - https://github.com/bbustin/dmarc_aggregate_parser was used as foundation for the slightly modified DMARC report parser