forked from bufbuild/buf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.workspace
38 lines (32 loc) · 1022 Bytes
/
Dockerfile.workspace
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
35
36
37
38
FROM golang:1.16.0-alpine3.12
ARG PROJECT
ARG GO_MODULE
ENV \
CACHE_BASE=/cache/$PROJECT \
GO111MODULE=on \
GOPRIVATE=$GO_MODULE \
GOPATH=/cache/$PROJECT/Linux/x86_64/go \
GOBIN=/cache/$PROJECT/Linux/x86_64/gobin \
PATH=/cache/$PROJECT/Linux/x86_64/gobin:/cache/$PROJECT/Linux/x86_64/bin:${PATH}
WORKDIR /workspace
RUN apk add --update --no-cache \
bash \
build-base \
ca-certificates \
curl \
git \
openssh-client \
unzip \
wget && \
rm -rf /var/cache/apk/*
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.31-r0/glibc-2.31-r0.apk && \
apk add --no-cache glibc-2.31-r0.apk && \
rm -rf /var/cache/apk/*
COPY go.mod go.sum /workspace/
# This replaces go mod download so that we only download what we need
# https://github.com/golang/go/issues/18387
RUN go list -test all
COPY make /workspace/make
COPY Makefile /workspace/
RUN make dockerdeps