blob: 675759f3b918ac180f12e6090c00c07e39a952b4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
FROM marketplace.gcr.io/google/debian11 AS build
#ENV BUILD_DEPS 'curl git gcc patch libc6-dev ca-certificates build-essential pkg-config'
ENV BUILD_DEPS 'ca-certificates git curl'
RUN apt-get update && apt-get install -y ${BUILD_DEPS} --no-install-recommends
ENV GOPATH=/go
ENV GOROOT_BOOTSTRAP=/usr/local/go-bootstrap
RUN curl -sSL https://dl.google.com/go/go1.17.6.linux-amd64.tar.gz -o /tmp/go.tar.gz
RUN mkdir -p $GOROOT_BOOTSTRAP
RUN tar --strip=1 -C $GOROOT_BOOTSTRAP -xzf /tmp/go.tar.gz
#RUN $GOROOT_BOOTSTRAP/bin/go install golang.org/dl/gotip@latest
#RUN /go/bin/gotip download
RUN mkdir -p /workdir
WORKDIR /workdir
COPY go.mod /workdir
COPY go.sum /workdir
RUN $GOROOT_BOOTSTRAP/bin/go mod download
COPY . /workdir
RUN $GOROOT_BOOTSTRAP/bin/go build -o /workdir/server ./cmd/server
FROM marketplace.gcr.io/google/debian11 AS run
RUN apt-get update && apt-get install -y --no-install-recommends exiftool tini
ENV PORT=8080
COPY --from=build /workdir/server /app/server
RUN mkdir -p /app
ENTRYPOINT /app/server
|