1
- FROM openjdk:12-alpine
1
+ FROM openjdk:16-slim-buster
2
2
3
- RUN apk add --no-cache \
4
- ca-certificates
5
-
6
- # set up nsswitch.conf for Go's "netgo" implementation
7
- # - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
8
- # - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
9
- RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
3
+ RUN apt-get update; apt-get install -y --no-install-recommends ca-certificates
10
4
11
5
ENV GOLANG_VERSION 1.15.6
12
6
13
7
RUN set -eux; \
14
- apk add --no-cache --virtual .build-deps \
15
- bash \
16
- gcc \
17
- musl-dev \
18
- openssl \
19
- go \
20
- ; \
8
+ apt-get install -y --no-install-recommends bash build-essential openssl golang-go curl wget; \
9
+ rm -rf /var/lib/apt/lists/*; \
21
10
export \
22
- # set GOROOT_BOOTSTRAP such that we can actually build Go
23
- GOROOT_BOOTSTRAP="$(go env GOROOT)" \
24
- # ... and set "cross-building" related vars to the installed system's values so that we create a build targeting the proper arch
25
- # (for example, if our build host is GOARCH=amd64, but our build env/image is GOARCH=386, our build needs GOARCH=386)
26
- GOOS="$(go env GOOS)" \
27
- GOARCH="$(go env GOARCH)" \
28
- GOHOSTOS="$(go env GOHOSTOS)" \
29
- GOHOSTARCH="$(go env GOHOSTARCH)" \
11
+ # set GOROOT_BOOTSTRAP such that we can actually build Go
12
+ GOROOT_BOOTSTRAP="$(go env GOROOT)" \
13
+ # ... and set "cross-building" related vars to the installed system's values so that we create a build targeting the proper arch
14
+ # (for example, if our build host is GOARCH=amd64, but our build env/image is GOARCH=386, our build needs GOARCH=386)
15
+ GOOS="$(go env GOOS)" \
16
+ GOARCH="$(go env GOARCH)" \
17
+ GOHOSTOS="$(go env GOHOSTOS)" \
18
+ GOHOSTARCH="$(go env GOHOSTARCH)" \
30
19
; \
31
- # also explicitly set GO386 and GOARM if appropriate
32
- # https://github.com/docker-library/golang/issues/184
33
- apkArch ="$(apk --print-arch )" ; \
34
- case "$apkArch " in \
35
- armhf) export GOARM='6' ;; \
36
- armv7) export GOARM='7' ;; \
37
- x86) export GO386='387' ;; \
20
+ # also explicitly set GO386 and GOARM if appropriate
21
+ # https://github.com/docker-library/golang/issues/184
22
+ dpkgArch ="$(dpkg --print-architecture )" ; \
23
+ case "$dpkgArch " in \
24
+ armhf) export GOARM='6' ;; \
25
+ armv7) export GOARM='7' ;; \
26
+ x86) export GO386='387' ;; \
38
27
esac; \
39
28
\
40
29
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz" ; \
@@ -45,13 +34,12 @@ RUN set -eux; \
45
34
./make.bash; \
46
35
\
47
36
rm -rf \
48
- # https://github.com/golang/go/blob/0b30cf534a03618162d3015c8705dd2231e34703/src/cmd/dist/buildtool.go#L121-L125
49
- /usr/local/go/pkg/bootstrap \
50
- # https://golang.org/cl/82095
51
- # https://github.com/golang/build/blob/e3fe1605c30f6a3fd136b561569933312ede8782/cmd/release/releaselet.go#L56
52
- /usr/local/go/pkg/obj \
37
+ # https://github.com/golang/go/blob/0b30cf534a03618162d3015c8705dd2231e34703/src/cmd/dist/buildtool.go#L121-L125
38
+ /usr/local/go/pkg/bootstrap \
39
+ # https://golang.org/cl/82095
40
+ # https://github.com/golang/build/blob/e3fe1605c30f6a3fd136b561569933312ede8782/cmd/release/releaselet.go#L56
41
+ /usr/local/go/pkg/obj \
53
42
; \
54
- apk del .build-deps; \
55
43
\
56
44
export PATH="/usr/local/go/bin:$PATH" ; \
57
45
go version
@@ -61,31 +49,36 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
61
49
ENV GO111MODULE=on
62
50
63
51
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
64
- RUN apk add -U --no-cache ca-certificates bash nodejs npm python3 python3-dev py-pip ruby jq build-base gnupg git openssh curl gettext libffi libffi-dev openssl-dev php composer php-curl php7-tokenizer wget php-dom php-xml php-simplexml php-xmlwriter maven
52
+ RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - && apt-get install -y nodejs
53
+ # the following is a workaround for openjdk-11-jre-headless erroring due to not having a man path in slim-debian
54
+ RUN mkdir /usr/share/man/man1/
55
+ RUN apt-get install -y --no-install-recommends python3 python3-dev python3-pip ruby jq gnupg git gettext libffi6 libffi-dev libssl-dev php composer php-curl php7.3-tokenizer php-dom php-xml php-simplexml php-xmlwriter maven
65
56
66
57
# RUN wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar -O openapi-generator-cli.jar
67
58
68
59
RUN npm i -g @openapitools/openapi-generator-cli
69
60
RUN openapi-generator-cli version-manager set 5.0.0
70
- RUN python3 -m pip install --upgrade pip
71
- RUN python3 -m pip install --user --upgrade setuptools wheel twine
61
+ RUN pip3 install --upgrade pip
62
+ RUN pip3 install --user --upgrade setuptools wheel twine
72
63
73
64
# dotnet
74
65
ENV PATH "$PATH:/root/.dotnet"
75
66
76
- RUN apk add --no-cache \
77
- lttng-ust-dev \
78
- icu-libs \
79
- zlib \
80
- && wget -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \
81
- && chmod +x dotnet-install.sh \
82
- && ./dotnet-install.sh --channel Current \
83
- && rm dotnet-install.sh
67
+ RUN apt-get install -y --no-install-recommends \
68
+ liblttng-ust-dev \
69
+ libicu-dev \
70
+ zlib1g \
71
+ && wget -O dotnet-install.sh https://dot.net/v1/dotnet-install.sh \
72
+ && chmod +x dotnet-install.sh \
73
+ && ./dotnet-install.sh --channel Current \
74
+ && rm dotnet-install.sh
75
+
76
+ RUN rm -rf /var/lib/apt/lists/*
84
77
85
78
RUN download_url=$(curl -s https://api.github.com/repos/go-swagger/go-swagger/releases/latest | \
86
- jq -r '.assets[] | select(.name | contains("' "$(uname | tr '[:upper:]' '[:lower:]')" '_amd64")) | .browser_download_url' ) \
87
- && curl -o /usr/local/bin/swagger -L'#' "$download_url" \
88
- && chmod +x /usr/local/bin/swagger
79
+ jq -r '.assets[] | select(.name | contains("' "$(uname | tr '[:upper:]' '[:lower:]')" '_amd64")) | .browser_download_url' ) \
80
+ && curl -o /usr/local/bin/swagger -L'#' "$download_url" \
81
+ && chmod +x /usr/local/bin/swagger
89
82
90
83
ADD go.mod go.mod
91
84
ADD go.sum go.sum
0 commit comments