mirror of https://github.com/daffainfo/nuclei.git
refactoring dockerfile (#563)
parent
5dde61f0a6
commit
7174c3f374
23
Dockerfile
23
Dockerfile
|
@ -1,19 +1,6 @@
|
|||
FROM golang:alpine as builder
|
||||
FROM golang:1.16.0-alpine as build-env
|
||||
RUN GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei
|
||||
|
||||
RUN mkdir -p /app
|
||||
WORKDIR /app
|
||||
COPY ./v2/go.mod .
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN cd ./v2/cmd/nuclei && go build -o nuclei .
|
||||
|
||||
FROM alpine
|
||||
|
||||
RUN mkdir /app
|
||||
RUN adduser --home /app --shell /bin/sh --disabled-password appuser
|
||||
COPY --from=builder /app/v2/cmd/nuclei/nuclei /app
|
||||
USER appuser
|
||||
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["/app/nuclei"]
|
||||
FROM alpine:latest
|
||||
COPY --from=build-env /go/bin/nuclei /usr/local/bin/nuclei
|
||||
ENTRYPOINT ["nuclei"]
|
||||
|
|
Loading…
Reference in New Issue