golang.org/x/playground@v0.0.0-20230418134305-14ebe15bcd59/sandbox/Dockerfile (about)

     1  # This is the sandbox backend server.
     2  #
     3  # When it's run, the host maps in /var/run/docker.sock to this
     4  # environment so the play-sandbox server can connect to the host's
     5  # docker daemon, which has the gvisor "runsc" runtime available.
     6  
     7  FROM golang:1.18 AS build
     8  
     9  COPY go.mod /go/src/playground/go.mod
    10  COPY go.sum /go/src/playground/go.sum
    11  WORKDIR /go/src/playground
    12  RUN go mod download
    13  
    14  COPY . /go/src/playground
    15  WORKDIR /go/src/playground/sandbox
    16  RUN go install
    17  
    18  FROM debian:buster
    19  
    20  RUN apt-get update
    21  
    22  # Extra stuff for occasional debugging:
    23  RUN apt-get install --yes strace lsof emacs-nox net-tools tcpdump procps
    24  
    25  # Install Docker CLI:
    26  RUN apt-get install --yes \
    27          apt-transport-https \
    28          ca-certificates \
    29          curl \
    30          gnupg2 \
    31          software-properties-common
    32  RUN bash -c "curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -"
    33  RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian buster stable"
    34  RUN apt-get update
    35  RUN apt-get install --yes docker-ce-cli
    36  
    37  COPY --from=build /go/bin/sandbox /usr/local/bin/play-sandbox
    38  
    39  ENTRYPOINT ["/usr/local/bin/play-sandbox"]