-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**What** - Create a docker image that pre-compiles the certifier tests so that the tests are more portable Signed-off-by: Lucas Roesler <[email protected]>
- Loading branch information
1 parent
30c5ee5
commit a7df90b
Showing
3 changed files
with
46 additions
and
0 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
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,40 @@ | ||
ARG goversion=1.14 | ||
ARG alpineversion=3.11 | ||
FROM golang:$goversion as builder | ||
|
||
|
||
WORKDIR /app | ||
|
||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
RUN go mod download | ||
|
||
ENV GO111MODULE=on | ||
ENV CGO_ENABLED=0 | ||
ARG GOOS=linux | ||
|
||
WORKDIR /app | ||
COPY tests ./tests | ||
COPY vendor ./vendor | ||
|
||
RUN go test -c -o certifier ./tests | ||
|
||
FROM alpine:$alpineversion | ||
|
||
RUN apk --no-cache --update add ca-certificates | ||
|
||
ARG USER=default | ||
ENV HOME /home/$USER | ||
|
||
# install sudo as root | ||
RUN apk add --update sudo | ||
|
||
# add new user | ||
RUN adduser -D $USER | ||
USER $USER | ||
WORKDIR $HOME | ||
|
||
COPY --from=builder /app/certifier /bin/certifier | ||
|
||
ENTRYPOINT [ "/bin/certifier" ] |
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