forked from juruen/rmapi
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
capcobot
committed
Apr 12, 2022
1 parent
c209c36
commit 60da0db
Showing
3 changed files
with
11 additions
and
27 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Dockerfile |
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,31 +1,14 @@ | ||
FROM golang:alpine AS builder | ||
RUN apk add --no-cache git | ||
|
||
ENV PATH /go/bin:/usr/local/go/bin:$PATH | ||
ENV GOPATH /go | ||
ENV SOURCEPATH ${GOPATH}/src/github.com/juruen/rmapi | ||
|
||
RUN apk add --no-cache \ | ||
bash | ||
|
||
COPY . ${SOURCEPATH} | ||
|
||
RUN set -x \ | ||
&& cd ${SOURCEPATH} \ | ||
&& go build . \ | ||
&& mv rmapi /usr/bin/rmapi | ||
|
||
WORKDIR /src | ||
COPY . . | ||
RUN CGO_ENABLED=0 go build | ||
|
||
FROM alpine:latest | ||
|
||
COPY --from=builder /usr/bin/rmapi /usr/bin/rmapi | ||
|
||
RUN adduser -D -u 1000 user \ | ||
&& chown -R user /home/user | ||
|
||
USER user | ||
|
||
ENV USER user | ||
|
||
WORKDIR /home/user | ||
RUN adduser -D app | ||
USER app | ||
|
||
ENTRYPOINT [ "rmapi" ] | ||
COPY --from=builder /src/rmapi /usr/local/bin/rmapi | ||
ENTRYPOINT ["rmapi"] |
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