mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-05 02:49:42 +00:00
Backport #1024 update alpine base image to current stable and cross-build with golang v1.18
This commit is contained in:
parent
d8a6b61918
commit
5e1aa4019a
10 changed files with 22 additions and 20 deletions
|
@ -22,7 +22,7 @@ pipeline:
|
|||
|
||||
build-server:
|
||||
group: build
|
||||
image: golang:1.16
|
||||
image: golang:1.18
|
||||
commands:
|
||||
- make release-server
|
||||
when:
|
||||
|
@ -38,7 +38,7 @@ pipeline:
|
|||
|
||||
build-agent:
|
||||
group: build
|
||||
image: golang:1.16
|
||||
image: golang:1.18
|
||||
commands:
|
||||
- make release-agent
|
||||
when:
|
||||
|
@ -54,7 +54,7 @@ pipeline:
|
|||
|
||||
build-cli:
|
||||
group: build
|
||||
image: golang:1.16
|
||||
image: golang:1.18
|
||||
commands:
|
||||
- make release-cli
|
||||
when:
|
||||
|
@ -70,7 +70,7 @@ pipeline:
|
|||
|
||||
build-deb-rpm:
|
||||
group: bundle
|
||||
image: golang:1.16
|
||||
image: golang:1.18
|
||||
commands:
|
||||
- make bundle
|
||||
when:
|
||||
|
@ -85,7 +85,7 @@ pipeline:
|
|||
- "web/**"
|
||||
|
||||
checksums:
|
||||
image: golang:1.16
|
||||
image: golang:1.18
|
||||
commands:
|
||||
- make release-checksums
|
||||
when:
|
||||
|
@ -102,7 +102,7 @@ pipeline:
|
|||
# TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH}
|
||||
|
||||
release-dryrun:
|
||||
image: golang:1.16
|
||||
image: golang:1.18
|
||||
commands:
|
||||
- ls -la dist/*.*
|
||||
- cat dist/checksums.txt
|
||||
|
|
|
@ -14,7 +14,7 @@ pipeline:
|
|||
- yarn build
|
||||
|
||||
cross-compile-server:
|
||||
image: techknowlogick/xgo:go-1.17.x
|
||||
image: techknowlogick/xgo:go-1.18.x
|
||||
commands:
|
||||
- apt update
|
||||
- apt install -y tree
|
||||
|
@ -22,6 +22,7 @@ pipeline:
|
|||
environment:
|
||||
PLATFORMS: linux|arm/v7;linux|arm64/v8;linux|amd64;linux|ppc64le
|
||||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
XGO_VERSION: go-1.18.x
|
||||
|
||||
publish-server-dryrun:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
|
|
2
Makefile
2
Makefile
|
@ -23,7 +23,7 @@ CGO_CFLAGS ?=
|
|||
|
||||
HAS_GO = $(shell hash go > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
||||
ifeq ($(HAS_GO), GO)
|
||||
XGO_VERSION ?= go-1.17.x
|
||||
XGO_VERSION ?= go-1.18.x
|
||||
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS)
|
||||
endif
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM --platform=$BUILDPLATFORM golang:1.16 AS build
|
||||
FROM --platform=$BUILDPLATFORM golang:1.18 AS build
|
||||
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
|
@ -7,7 +7,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
|
|||
--mount=type=cache,target=/go/pkg \
|
||||
make build-agent
|
||||
|
||||
FROM alpine:3.14
|
||||
FROM alpine:3.16
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
ENV GODEBUG=netdns=go
|
||||
EXPOSE 3000
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM --platform=$BUILDPLATFORM golang:1.16 AS build
|
||||
FROM --platform=$BUILDPLATFORM golang:1.18 AS build
|
||||
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
|
@ -11,7 +11,7 @@ FROM scratch
|
|||
ENV GODEBUG=netdns=go
|
||||
EXPOSE 3000
|
||||
|
||||
# copy certs from golang:1.16 image
|
||||
# copy certs from golang:1.18 image
|
||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
# copy agent binary
|
||||
COPY --from=build /src/dist/woodpecker-agent /bin/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM --platform=$BUILDPLATFORM golang:1.16 AS build
|
||||
FROM --platform=$BUILDPLATFORM golang:1.18 AS build
|
||||
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
|
@ -7,7 +7,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
|
|||
--mount=type=cache,target=/go/pkg \
|
||||
make build-cli
|
||||
|
||||
FROM alpine:3.14
|
||||
FROM alpine:3.16
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
ENV GODEBUG=netdns=go
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM --platform=$BUILDPLATFORM golang:1.16 AS build
|
||||
FROM --platform=$BUILDPLATFORM golang:1.18 AS build
|
||||
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
|
@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
|
|||
FROM scratch
|
||||
ENV GODEBUG=netdns=go
|
||||
|
||||
# copy certs from golang:1.16 image
|
||||
# copy certs from golang:1.18 image
|
||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
# copy cli binary
|
||||
COPY --from=build /src/dist/woodpecker-cli /bin/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# docker build --rm -f docker/Dockerfile.server -t woodpeckerci/woodpecker-server .
|
||||
FROM golang:1.16-alpine as golang_image
|
||||
FROM golang:1.18-alpine as golang_image
|
||||
FROM node:16-alpine
|
||||
|
||||
RUN apk add make gcc musl-dev
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
FROM alpine:3.14
|
||||
FROM alpine:3.16
|
||||
|
||||
ARG TARGETOS TARGETARCH
|
||||
RUN apk add -U --no-cache ca-certificates
|
||||
ENV GODEBUG=netdns=go
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM golang:1.16 AS certs
|
||||
FROM golang:1.18 AS certs
|
||||
|
||||
FROM scratch
|
||||
ARG TARGETOS TARGETARCH
|
||||
|
@ -8,7 +8,7 @@ ENV WOODPECKER_DATABASE_DRIVER=sqlite3
|
|||
ENV XDG_CACHE_HOME=/var/lib/woodpecker
|
||||
EXPOSE 8000 9000 80 443
|
||||
|
||||
# copy certs from golang:1.16 image
|
||||
# copy certs from golang:1.18 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/
|
||||
|
|
Loading…
Reference in a new issue