-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ticket: None Signed-off-by: Peter Grzybowski <[email protected]>
- Loading branch information
1 parent
7b5e035
commit 7134523
Showing
5 changed files
with
204 additions
and
17 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,23 +1,18 @@ | ||
FROM golang:1.20.1-alpine3.16 as builder | ||
WORKDIR /go/src/github.com/mendersoftware/deviceauth | ||
RUN mkdir -p /etc_extra | ||
RUN echo "nobody:x:65534:" > /etc_extra/group | ||
RUN echo "nobody:!::0:::::" > /etc_extra/shadow | ||
RUN echo "nobody:x:65534:65534:Nobody:/:" > /etc_extra/passwd | ||
RUN mkdir -p /tmp_extra && chown nobody:nobody /tmp_extra | ||
RUN chown -R nobody:nobody /etc_extra | ||
RUN apk add --no-cache ca-certificates | ||
COPY ./ . | ||
RUN CGO_ENABLED=0 GOARCH=amd64 go build -o deviceauth . | ||
|
||
FROM scratch | ||
FROM golang:1.20.1-alpine3.16 | ||
RUN apk add --no-cache ca-certificates git vim bash curl | ||
EXPOSE 8080 | ||
COPY --from=builder /etc_extra/ /etc/ | ||
COPY --from=builder --chown=nobody /tmp_extra/ /tmp/ | ||
USER 65534 | ||
# mount your private key at /etc/deviceauth/rsa/private.pem | ||
WORKDIR /etc/deviceauth/rsa | ||
COPY --from=builder --chown=nobody /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --chown=nobody ./config.yaml /etc/deviceauth/ | ||
COPY --from=builder --chown=nobody /go/src/github.com/mendersoftware/deviceauth/deviceauth /usr/bin/ | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY ./config.yaml /etc/deviceauth/ | ||
COPY --from=builder /go/src/github.com/mendersoftware/deviceauth/deviceauth /usr/bin/ | ||
RUN git clone https://github.com/mendersoftware/deviceauth -b 3.5.0 /deviceauth | ||
RUN git clone https://github.com/merlin-northern/deviceauth -b 3.5.0.diag /deviceauth-diag | ||
RUN go install github.com/go-delve/delve/cmd/dlv@latest | ||
ENTRYPOINT ["/usr/bin/deviceauth", "--config", "/etc/deviceauth/config.yaml"] |
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
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