pre-warm go

This commit is contained in:
Ruben Fiszel
2023-09-06 14:27:23 +02:00
parent 1a9cc6b9a6
commit 8afa901272
+3
View File
@@ -164,6 +164,9 @@ RUN set -eux; \
ENV PATH="${PATH}:/usr/local/go/bin"
ENV GO_PATH=/usr/local/go/bin/go
# go build is slower the first time it is ran, so we prewarm it in the build
RUN mkdir -p /tmp/gobuildwarm && cd /tmp/gobuildwarm && go mod init gobuildwarm && printf "package foo\nimport (\"fmt\")\nfmt.Println(42)" > warm.go && go build -x && rm -rf /tmp/gobuildwarm
ENV TZ=Etc/UTC
RUN /usr/local/bin/python3 -m pip install pip-tools