aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2022-02-10 09:37:46 +0000
committerGitHub <noreply@github.com>2022-02-10 09:37:46 +0000
commit9130156b131ec5a1714f4a7f6e54f12657d655a1 (patch)
treeece36550e809e326b2dfd7c3e4d5405d80b44c89 /build
parent37cbe263ce89681b0aeb7fef30e05d6125df162f (diff)
Make the Complement Dockerfile use a fresh directory for runtime (#2168)
Diffstat (limited to 'build')
-rw-r--r--build/scripts/Complement.Dockerfile12
1 files changed, 9 insertions, 3 deletions
diff --git a/build/scripts/Complement.Dockerfile b/build/scripts/Complement.Dockerfile
index 401695ab..a54fab1d 100644
--- a/build/scripts/Complement.Dockerfile
+++ b/build/scripts/Complement.Dockerfile
@@ -2,6 +2,10 @@ FROM golang:1.16-stretch as build
RUN apt-get update && apt-get install -y sqlite3
WORKDIR /build
+# we will dump the binaries and config file to this location to ensure any local untracked files
+# that come from the COPY . . file don't contaminate the build
+RUN mkdir /dendrite
+
# Utilise Docker caching when downloading dependencies, this stops us needlessly
# downloading dependencies every time.
COPY go.mod .
@@ -9,9 +13,11 @@ COPY go.sum .
RUN go mod download
COPY . .
-RUN go build ./cmd/dendrite-monolith-server
-RUN go build ./cmd/generate-keys
-RUN go build ./cmd/generate-config
+RUN go build -o /dendrite ./cmd/dendrite-monolith-server
+RUN go build -o /dendrite ./cmd/generate-keys
+RUN go build -o /dendrite ./cmd/generate-config
+
+WORKDIR /dendrite
RUN ./generate-keys --private-key matrix_key.pem
ENV SERVER_NAME=localhost