-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GH-8] docker image could not be built due to missing files
- Loading branch information
Showing
3 changed files
with
13 additions
and
12 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,19 +1,16 @@ | ||
FROM golang:1.12.4-alpine as builder | ||
RUN mkdir n3dr && \ | ||
adduser -D -g '' n3dr | ||
COPY main.go go.mod go.sum ./n3dr/ | ||
COPY cli ./n3dr/cli | ||
COPY . ./n3dr/ | ||
WORKDIR n3dr | ||
RUN ls && \ | ||
RUN adduser -D -g '' n3dr && \ | ||
apk add git && \ | ||
ls && \ | ||
CGO_ENABLED=0 go build && \ | ||
ls && \ | ||
cp n3dr /n3dr | ||
cp n3dr /n3dr && \ | ||
chmod 100 /n3dr | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/group /etc/group | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /n3dr /usr/local/n3dr | ||
COPY --from=builder --chown=n3dr:n3dr /n3dr /usr/local/n3dr | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
USER n3dr | ||
ENTRYPOINT ["/usr/local/n3dr"] |
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
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