Skip to content

Commit

Permalink
Leave no apk cache in Docker image (#1112)
Browse files Browse the repository at this point in the history
Use `apk add` with `--no-cache` will prevent leaving cache in the released image, and it's now kind of Dockerfile best practice.
  • Loading branch information
PeterDaveHello authored Jun 11, 2024
1 parent 2b23f06 commit 81556dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build
FROM golang:1.22.4-alpine AS builder
RUN apk add build-base libpcap-dev
RUN apk add --no-cache build-base libpcap-dev
WORKDIR /app
COPY . /app
WORKDIR /app/v2
Expand All @@ -9,6 +9,6 @@ RUN go build ./cmd/naabu

# Release
FROM alpine:3.20.0
RUN apk add nmap libpcap-dev bind-tools ca-certificates nmap-scripts
RUN apk add --no-cache nmap libpcap-dev bind-tools ca-certificates nmap-scripts
COPY --from=builder /app/v2/naabu /usr/local/bin/
ENTRYPOINT ["naabu"]

0 comments on commit 81556dc

Please sign in to comment.