Skip to content

Commit

Permalink
Revert "chore(docker): single-stage build"
Browse files Browse the repository at this point in the history
This reverts commit e9665c8.
  • Loading branch information
dwisiswant0 committed Sep 20, 2024
1 parent e9665c8 commit ac9e344
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM golang:1.21-alpine

WORKDIR /usr/src/nuclei

COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . ./
RUN apk add build-base bind-tools chromium ca-certificates
RUN go build -v -ldflags '-extldflags "-static"' \
-o /usr/local/bin/nuclei ./cmd/nuclei/main.go

CMD ["nuclei"]
# Build
FROM golang:1.21-alpine AS build-env
RUN apk add build-base
WORKDIR /app
COPY . /app
RUN go mod download
RUN go build ./cmd/nuclei

# Release
FROM alpine:3.18.6
RUN apk upgrade --no-cache \
&& apk add --no-cache bind-tools chromium ca-certificates
COPY --from=build-env /app/nuclei /usr/local/bin/

ENTRYPOINT ["nuclei"]

0 comments on commit ac9e344

Please sign in to comment.