Skip to content

Commit

Permalink
Change Dockerfile to run as non-root user (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcaracuel committed Jul 11, 2024
1 parent 52fc54a commit a9feb8d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
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"]

0 comments on commit a9feb8d

Please sign in to comment.