Skip to content

Commit

Permalink
Generalized Dockerfile to allow ARM builds
Browse files Browse the repository at this point in the history
  • Loading branch information
cry-inc committed Jan 2, 2025
1 parent b900c5c commit 3dac893
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3dac893

Please sign in to comment.