Skip to content

Commit a475b88

Browse files
committed
chore(registry): add codename build-arg
1 parent 8484ea6 commit a475b88

4 files changed

Lines changed: 7 additions & 3 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 test
1616
secrets:
17+
- codename
1718
- dev_registry
1819
when:
1920
event:

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ARG CODENAME
2+
13
FROM registry.drycc.cc/drycc/go-dev:latest AS build
24
ARG LDFLAGS
35
ADD . /workspace
@@ -7,7 +9,7 @@ RUN export GO111MODULE=on \
79
&& upx -9 --brute /usr/local/bin/registry
810

911

10-
FROM registry.drycc.cc/drycc/base:bookworm
12+
FROM registry.drycc.cc/drycc/base:${CODENAME}
1113

1214
ENV DRYCC_UID=1001 \
1315
DRYCC_GID=1001 \

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ build: check-docker
3636
# For cases where we're building from local
3737
# We also alter the RC file to set the image name.
3838
docker-build: check-docker
39-
docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} .
39+
docker build ${DOCKER_BUILD_FLAGS} --build-arg CODENAME=${CODENAME} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} .
4040
docker tag ${IMAGE} ${MUTABLE_IMAGE}
4141

4242
docker-buildx: check-docker
43-
docker buildx build --platform ${PLATFORM} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} . --push
43+
docker buildx build --build-arg CODENAME=${CODENAME} --platform ${PLATFORM} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} . --push
4444

4545
build-binary:
4646
${DEV_ENV_CMD} go build -ldflags ${LDFLAGS} -o $(BINDIR)/${SHORT_NAME} main.go

0 commit comments

Comments
 (0)