File tree 2 files changed +29
-4
lines changed 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -710,8 +710,12 @@ jobs:
710
710
# replace + with - in tag
711
711
tag="${tag/+/-}"
712
712
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
715
719
716
720
# export version, base_tag, and tag as outputs
717
721
echo "version=$version" >> $GITHUB_OUTPUT
@@ -725,7 +729,7 @@ jobs:
725
729
uses : depot/build-push-action@v1
726
730
with :
727
731
project : 9rcqzb56rm
728
- context : ./tmp
732
+ context : ./base-build-context
729
733
platforms : linux/amd64,linux/arm64,linux/arm/v7
730
734
tags : ${{ steps.build.outputs.base_tag }}
731
735
file : ./scripts/Dockerfile.base
@@ -736,7 +740,7 @@ jobs:
736
740
uses : depot/build-push-action@v1
737
741
with :
738
742
project : 9rcqzb56rm
739
- context : ./tmp
743
+ context : ./build-context
740
744
platforms : linux/amd64,linux/arm64,linux/arm/v7
741
745
file : ./scripts/Dockerfile
742
746
push : ${{ github.event_name != 'pull_request' }}
Original file line number Diff line number Diff line change
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" ]
You can’t perform that action at this time.
0 commit comments