-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "chore(docker): single-stage build"
This reverts commit e9665c8.
- Loading branch information
1 parent
e9665c8
commit ac9e344
Showing
1 changed file
with
15 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |