-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.Dockerfile
36 lines (32 loc) · 1.04 KB
/
build.Dockerfile
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
FROM golang:1.13.5-alpine3.11
LABEL maintainer="Max Kuznetsov <[email protected]>"
ENV \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64 \
GO111MODULE="on" \
LOGIN=sandbox \
UID=2000
RUN \
apk add --no-cache --update curl ca-certificates python3 py3-yaml py3-requests wget git && \
adduser -s /bin/sh -D -u $UID $LOGIN && \
mkdir -p /out /opt/bin && \
chown -R $LOGIN:$LOGIN /out
RUN \
go get golang.org/x/tools/cmd/[email protected] && \
go get github.com/mkuznets/[email protected] && \
go mod download gonum.org/v1/[email protected] && \
chown -R $LOGIN:$LOGIN /go
WORKDIR /
COPY godocs /opt
COPY sandbox/build /opt/bin
RUN \
patch -N $(go env GOROOT)/src/fmt/print.go /opt/noprint.patch && \
chmod -R +x /opt/bin && \
ln -s /opt/bin/build.py /opt/bin/build
ENTRYPOINT ["/opt/bin/init.sh"]
USER ${UID}
COPY stdlib-tests /stdlib-tests
COPY stdlib /stdlib
RUN cd /stdlib && go generate ./... && /opt/bin/build.py test-all
COPY linter_config.yaml /linter_config.yaml