Skip to content

Commit b6ee23b

Browse files
committed
experiment
1 parent 6e136e1 commit b6ee23b

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,12 @@ jobs:
710710
# replace + with - in tag
711711
tag="${tag/+/-}"
712712
713-
# create an empty build directory
714-
mkdir -p tmp
713+
# create an empty build context directory
714+
mkdir -p build-context
715+
mkdir -p base-build-context
716+
717+
# copy the build artifacts to the build context
718+
cp build/coder_*_linux_* build-context
715719
716720
# export version, base_tag, and tag as outputs
717721
echo "version=$version" >> $GITHUB_OUTPUT
@@ -725,7 +729,7 @@ jobs:
725729
uses: depot/build-push-action@v1
726730
with:
727731
project: 9rcqzb56rm
728-
context: ./tmp
732+
context: ./base-build-context
729733
platforms: linux/amd64,linux/arm64,linux/arm/v7
730734
tags: ${{ steps.build.outputs.base_tag }}
731735
file: ./scripts/Dockerfile.base
@@ -736,7 +740,7 @@ jobs:
736740
uses: depot/build-push-action@v1
737741
with:
738742
project: 9rcqzb56rm
739-
context: ./tmp
743+
context: ./build-context
740744
platforms: linux/amd64,linux/arm64,linux/arm/v7
741745
file: ./scripts/Dockerfile
742746
push: ${{ github.event_name != 'pull_request' }}

scripts/Dockerfile.multi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This is the multi-arch Dockerfile used for Coder. Since it's multi-arch and
2+
# cross-compiled, it cannot have ANY "RUN" commands. All binaries are built
3+
# using the go toolchain on the host and then copied into the build context manullay.
4+
ARG BASE_IMAGE
5+
FROM $BASE_IMAGE
6+
7+
# LABEL doesn't add any real layers so it's fine (and easier) to do it here than
8+
# in the build script.
9+
ARG CODER_VERSION
10+
LABEL \
11+
org.opencontainers.image.title="Coder" \
12+
org.opencontainers.image.description="A tool for provisioning self-hosted development environments with Terraform." \
13+
org.opencontainers.image.url="https://github.com/coder/coder" \
14+
org.opencontainers.image.source="https://github.com/coder/coder" \
15+
org.opencontainers.image.version="$CODER_VERSION"
16+
17+
18+
# The coder binary is available in the build context.
19+
COPY --chown=1000:1000 --chmod=755 coder_*_linux_${TARGETARCH} /opt/coder
20+
21+
ENTRYPOINT [ "/opt/coder", "server" ]

0 commit comments

Comments
 (0)