-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build multiarch images for server (#821)
Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Anbraten <anton@ju60.de>
- Loading branch information
1 parent
09e6460
commit da99f47
Showing
8 changed files
with
76 additions
and
44 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
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
9 changes: 3 additions & 6 deletions
9
docker/Dockerfile.server.alpine → docker/Dockerfile.server.alpine.multiarch
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,15 +1,12 @@ | ||
# docker build --rm -f docker/Dockerfile.server.alpine -t woodpeckerci/woodpecker-server . | ||
|
||
FROM alpine:3.14 | ||
ARG TARGETOS TARGETARCH | ||
RUN apk add -U --no-cache ca-certificates | ||
|
||
EXPOSE 8000 9000 80 443 | ||
|
||
ENV GODEBUG=netdns=go | ||
ENV WOODPECKER_DATABASE_DATASOURCE=/var/lib/woodpecker/woodpecker.sqlite | ||
ENV WOODPECKER_DATABASE_DRIVER=sqlite3 | ||
ENV XDG_CACHE_HOME=/var/lib/woodpecker | ||
EXPOSE 8000 9000 80 443 | ||
|
||
ADD dist/server/linux_amd64/woodpecker-server /bin/ | ||
COPY dist/server/${TARGETOS}/${TARGETARCH}/woodpecker-server /bin/ | ||
|
||
ENTRYPOINT ["/bin/woodpecker-server"] |
18 changes: 7 additions & 11 deletions
18
docker/Dockerfile.server → docker/Dockerfile.server.multiarch
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,20 +1,16 @@ | ||
# docker build --rm -f docker/Dockerfile.server -t woodpeckerci/woodpecker-server . | ||
|
||
# use golang image to copy ssl certs later | ||
FROM golang:1.16 | ||
FROM golang:1.16 AS certs | ||
|
||
FROM scratch | ||
|
||
# copy certs from golang:1.16 image | ||
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
|
||
EXPOSE 8000 9000 80 443 | ||
|
||
ARG TARGETOS TARGETARCH | ||
ENV GODEBUG=netdns=go | ||
ENV WOODPECKER_DATABASE_DATASOURCE=/var/lib/woodpecker/woodpecker.sqlite | ||
ENV WOODPECKER_DATABASE_DRIVER=sqlite3 | ||
ENV XDG_CACHE_HOME=/var/lib/woodpecker | ||
EXPOSE 8000 9000 80 443 | ||
|
||
ADD dist/server/linux_amd64/woodpecker-server /bin/ | ||
# copy certs from golang:1.16 image | ||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
# copy server binary | ||
COPY dist/server/${TARGETOS}/${TARGETARCH}/woodpecker-server /bin/ | ||
|
||
ENTRYPOINT ["/bin/woodpecker-server"] |