Skip to content

Commit

Permalink
Add a new Alpine-based Docker image.
Browse files Browse the repository at this point in the history
This was adapted from PR #77.

Co-authored-by: Thomas Munn <48925191+munntjlx@users.noreply.github.com>
  • Loading branch information
bradlarsen and munntjlx committed Oct 16, 2023
1 parent 020e5fb commit 6bf13dc
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
################################################################################
# Build `noseyparker`
#
# We use the alpine current, since it's smaller than most debian releases.
################################################################################
FROM rust:1.72-alpine3.18 AS builder

# Install dependencies
RUN apk add --no-cache --no-interactive \
build-base \
cmake \
git \
make \
musl-dev \
ninja-build \
openssl \
openssl-dev \
perl \
zsh \
&& \
apk cache clean

WORKDIR "/noseyparker"

COPY . .

RUN ./scripts/create-release.zsh && cp -r release /release

################################################################################
# Build a smaller image just for running the `noseyparker` binary
################################################################################
FROM alpine:3.18 as runner

# Add `git` so that noseyparker's git and github integration works
RUN apk add --no-cache --no-interactive git
COPY --from=builder /release /usr/local/

# Tip when running: use a volume mount: `-v "$PWD:/scan"` to make for handling of paths on the command line
WORKDIR "/scan"

ENTRYPOINT ["noseyparker"]

0 comments on commit 6bf13dc

Please sign in to comment.