-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix minor drone issues * Try building images from scratch * Ensure /tmp is creted * Add compression to scratch * Try goreleaser docker * Add more configuration for goreleaser * Disable drone docker tagging for now
- Loading branch information
Showing
8 changed files
with
135 additions
and
28 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
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,21 @@ | ||
# build stage | ||
FROM golang:1.11-alpine AS builder | ||
RUN apk add --update upx ca-certificates tzdata && update-ca-certificates | ||
|
||
RUN adduser -D -g '' appuser | ||
|
||
COPY drone-cache /bin/ | ||
WORKDIR /bin | ||
RUN upx drone-cache | ||
|
||
# final stage | ||
FROM scratch | ||
|
||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /bin/drone-cache /bin/ | ||
|
||
USER appuser | ||
|
||
ENTRYPOINT ["/bin/drone-cache"] |
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,30 @@ | ||
# build stage | ||
FROM golang:1.11-alpine AS builder | ||
RUN apk add --update make git upx ca-certificates tzdata \ | ||
&& update-ca-certificates | ||
|
||
RUN adduser -D -g '' appuser | ||
|
||
ENV BUILD_DIR /build | ||
|
||
COPY go.* Makefile $BUILD_DIR/ | ||
WORKDIR $BUILD_DIR | ||
RUN make fetch-dependencies | ||
|
||
COPY . $BUILD_DIR | ||
|
||
RUN make drone-cache | ||
RUN make compress | ||
RUN cp drone-cache /bin | ||
|
||
# final stage | ||
FROM scratch | ||
|
||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /bin/drone-cache /bin/ | ||
|
||
USER appuser | ||
|
||
ENTRYPOINT ["/bin/drone-cache"] |
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