Skip to content

Commit e6e9ed1

Browse files
committed
chore(builder): add codename build-arg
1 parent a86c783 commit e6e9ed1

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

.woodpecker/build-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pipeline:
1616
- echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
1717
- make docker-build docker-immutable-push
1818
secrets:
19+
- codename
1920
- dev_registry
2021
- drycc_registry
2122
- container_username

.woodpecker/test-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pipeline:
1414
commands:
1515
- make bootstrap test test-cover
1616
secrets:
17+
- codename
1718
- dev_registry
1819
when:
1920
event:

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
ARG LDFLAGS CODENAME
2+
13
FROM registry.drycc.cc/drycc/go-dev:latest AS build
2-
ARG LDFLAGS
34
ADD . /workspace
45
RUN export GO111MODULE=on \
56
&& cd /workspace \
67
&& CGO_ENABLED=0 init-stack go build -ldflags "${LDFLAGS}" -o /usr/local/bin/boot boot.go
78

8-
9-
FROM registry.drycc.cc/drycc/base:bookworm
9+
FROM registry.drycc.cc/drycc/base:${CODENAME}
1010

1111
ENV DRYCC_UID=1001 \
1212
DRYCC_GID=1001 \

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
SHORT_NAME ?= builder
22

33
include versioning.mk
4+
DRYCC_REGISTRY ?= ${DEV_REGISTRY}
45

56
# dockerized development environment variables
67
REPO_PATH := github.com/drycc/${SHORT_NAME}
@@ -18,8 +19,6 @@ LDFLAGS := "-s -w -X main.version=${VERSION}"
1819
# Docker Root FS
1920
BINDIR := ./rootfs
2021

21-
DRYCC_REGISTRY ?= ${DEV_REGISTRY}
22-
2322
bootstrap:
2423
${DEV_ENV_CMD} go mod vendor
2524

@@ -44,11 +43,11 @@ test-cover:
4443
${DEV_ENV_CMD} test-cover.sh
4544

4645
docker-build:
47-
docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} .
46+
docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} --build-arg CODENAME=${CODENAME} .
4847
docker tag ${IMAGE} ${MUTABLE_IMAGE}
4948

5049
docker-buildx:
51-
docker buildx build --platform ${PLATFORM} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} . --push
50+
docker buildx build --platform ${PLATFORM} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} --build-arg CODENAME=${CODENAME} --push .
5251

5352
check-kubectl:
5453
@if [ -z $$(which kubectl) ]; then \

0 commit comments

Comments
 (0)