-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Dockerfile to run as non-root user (#80)
- Loading branch information
Showing
1 changed file
with
11 additions
and
11 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,14 +1,14 @@ | ||
FROM golang:1.21.4-alpine AS builder | ||
WORKDIR /src/ | ||
COPY . . | ||
RUN go get -d -v ./... | ||
RUN go build -o liquidator | ||
WORKDIR /src/ | ||
COPY . . | ||
RUN go get -d -v ./... | ||
RUN go build -o liquidator | ||
|
||
FROM alpine:latest | ||
RUN apk --no-cache add ca-certificates | ||
WORKDIR /src/ | ||
COPY --from=builder /src/liquidator . | ||
|
||
EXPOSE 9000 | ||
|
||
ENTRYPOINT ["./liquidator"] | ||
RUN adduser -D ep | ||
RUN apk --no-cache add ca-certificates | ||
USER ep | ||
WORKDIR /home/ep | ||
COPY --from=builder /src/liquidator /usr/bin/liquidator | ||
EXPOSE 9000 | ||
ENTRYPOINT ["liquidator"] |