Skip to content

Commit 8e01013

Browse files
committed
playground: isolate playground build stage in Docker
This ensures that our build environment is isolated from the faketime build environment. Updates golang/go#25224 Change-Id: I7ad483f34483bc00ef097e8b92ce45d8936f47f1 Reviewed-on: https://go-review.googlesource.com/c/playground/+/228262 Run-TryBot: Alexander Rakoczy <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 688d9f6 commit 8e01013

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
ARG GO_VERSION=go1.14.1
66

7-
FROM debian:buster AS build
7+
FROM debian:buster AS go-faketime
88
LABEL maintainer="[email protected]"
99

1010
ENV BUILD_DEPS 'curl git gcc patch libc6-dev ca-certificates'
@@ -36,6 +36,8 @@ RUN ./make.bash
3636
ENV GOROOT /usr/local/go-faketime
3737
RUN ../bin/go install --tags=faketime std
3838

39+
FROM golang:1.14 as build-playground
40+
3941
COPY go.mod /go/src/playground/go.mod
4042
COPY go.sum /go/src/playground/go.sum
4143
WORKDIR /go/src/playground
@@ -51,7 +53,7 @@ FROM debian:buster
5153

5254
RUN apt-get update && apt-get install -y git ca-certificates --no-install-recommends
5355

54-
COPY --from=build /usr/local/go-faketime /usr/local/go-faketime
56+
COPY --from=go-faketime /usr/local/go-faketime /usr/local/go-faketime
5557

5658
ARG GO_VERSION
5759
ENV GO_VERSION ${GO_VERSION}
@@ -80,7 +82,7 @@ RUN mkdir -p $GOPATH/src/code.google.com/p/go-tour && \
8082

8183
RUN mkdir /app
8284

83-
COPY --from=build /go/bin/playground /app
85+
COPY --from=build-playground /go/bin/playground /app
8486
COPY edit.html /app
8587
COPY static /app/static
8688
COPY examples /app/examples

0 commit comments

Comments
 (0)