-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.amd64
38 lines (32 loc) · 1.29 KB
/
Dockerfile.amd64
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 webhippie/alpine:latest-amd64 as download
RUN cd /tmp && \
curl -sSL -o upx.tar.xz https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz && \
tar -xvf upx.tar.xz --strip-components=1
FROM webhippie/alpine:latest-amd64
LABEL maintainer="Thomas Boerger <thomas@webhippie.de>" \
org.label-schema.name="Golang" \
org.label-schema.version="1.13" \
org.label-schema.vendor="Thomas Boerger" \
org.label-schema.schema-version="1.0"
WORKDIR /srv/app
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["bash"]
ENV GOPATH /srv/app
ENV PATH /srv/app/bin:/usr/local/go/bin:${PATH}
ENV GO111MODULE auto
COPY ./overlay ./overlay-amd64 /
COPY --from=download /tmp/upx /usr/bin/upx
RUN apk update && \
apk upgrade && \
apk add gcc musl-dev openssl openssh-client make git git-lfs mercurial go protoc protobuf-dev binutils-gold && \
export GOROOT_BOOTSTRAP="$(go env GOROOT)" && \
export GOOS="$(go env GOOS)" && \
export GOARCH="$(go env GOARCH)" && \
export GOHOSTOS="$(go env GOHOSTOS)" && \
export GOHOSTARCH="$(go env GOHOSTARCH)" && \
curl -sLo - https://golang.org/dl/go1.13.4.src.tar.gz | tar -xzf - -C /usr/local && \
cd /usr/local/go/src && \
bash make.bash && \
rm -rf /usr/local/go/pkg/bootstrap /usr/local/go/pkg/obj && \
apk del go && \
rm -rf /var/cache/apk/*