forked from eksctl-io/eksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.deps
48 lines (39 loc) · 1.49 KB
/
Dockerfile.deps
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
39
40
41
42
43
44
45
46
47
48
# Make sure to bump the version of EKSCTL_DEPENDENCIES_IMAGE if you make any changes
# to this file
# This digest corresponds to golang:1.12.6-alpine3.9 (when Alpine was pointing to 3.9.4)
FROM golang@sha256:39677a9dd517a8e5d514dff8e36fa46ecc3fb14618b970bfaf3100cb8fab9ba6
# Build-time dependencies
RUN apk add --no-cache \
curl \
git \
make \
bash \
gcc \
g++ \
libsass-dev \
musl-dev \
&& true
WORKDIR /src
ENV CGO_ENABLED=0
COPY install-build-deps.sh go.mod go.sum /src/
# Install all go dependencies and remove the go caches in a single step to reduce the image footprint
# (caches won't be used later on, we overwrite them by volume-mounting)
RUN ./install-build-deps.sh && \
go install github.com/goreleaser/goreleaser && \
go build github.com/kubernetes-sigs/aws-iam-authenticator/cmd/aws-iam-authenticator && \
rm -rf /root/.cache/go-build /go/pkg/mod
# Runtime dependencies. Build the root filesystem of the eksctl image at /out
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
RUN apk add --no-cache --initdb --root /out \
alpine-baselayout \
busybox \
ca-certificates \
coreutils \
git \
libc6-compat \
openssh \
&& true
RUN mv ./aws-iam-authenticator /out/usr/local/bin/aws-iam-authenticator
ENV KUBECTL_VERSION v1.11.5
RUN curl --silent --location "https://dl.k8s.io/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" --output /out/usr/local/bin/kubectl \
&& chmod +x /out/usr/local/bin/kubectl