github.com/grahambrereton-form3/tilt@v0.10.18/synclet/Dockerfile (about)

     1  ARG baseImage="golang:1.12-alpine"
     2  
     3  FROM ${baseImage} as builder
     4  
     5  WORKDIR /go/src/github.com/windmilleng/tilt
     6  
     7  # Add the source code
     8  # (from current dir, add all files to dockerspace: /go/src...)
     9  # (assumes that this is being run from $GOPATH/.../windmilleng/tilt
    10  ADD . .
    11  
    12  RUN mkdir -p /app
    13  
    14  RUN apk add build-base
    15  
    16  # Build the server binary.
    17  RUN go build -o server ./cmd/synclet/main.go
    18  RUN mv server /app/
    19  
    20  # Build an image with just the Go cache artifacts
    21  FROM golang:1.12-alpine as go-cache
    22  
    23  COPY --from=builder /root/.cache /root/.cache
    24  
    25  # Create a minimal image with just the binary.
    26  FROM alpine:latest
    27  
    28  WORKDIR /app
    29  COPY --from=builder /app/server .
    30  
    31  ENTRYPOINT ["./server"]