forked from eksctl-io/eksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (42 loc) · 1.62 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Make sure to run the following commands after changes to this file are made:
# `make -f Makefile.docker update-build-image-tag && make -f Makefile.docker push-build-image`
FROM golang:1.14-2-alpine3.11@sha256:9b3ad7928626126b72b916609ad081cfb6c0149f6e60cef7fc1e9e15a0d1e973 AS base
# Build-time dependencies
RUN apk add --no-cache \
bash \
curl \
docker-cli \
g++ \
gcc \
git \
libsass-dev \
make \
musl-dev \
jq \
&& true
# 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
ENV KUBECTL_VERSION v1.15.11
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
# Remaining dependencies are controlled by go.mod
WORKDIR /src
ENV CGO_ENABLED=0 GOPROXY=https://proxy.golang.org,direct
RUN git config --global url."[email protected]:".insteadOf "https://github.com/"
COPY .requirements install-build-deps.sh go.mod go.sum /src/
# Install all build tools dependencies
RUN ./install-build-deps.sh
# The authenticator is a runtime dependency, so it needs to be in /out
RUN go install sigs.k8s.io/aws-iam-authenticator/cmd/aws-iam-authenticator \
&& mv $GOPATH/bin/aws-iam-authenticator /out/usr/local/bin/aws-iam-authenticator
# Add kubectl and aws-iam-authenticator to the PATH
ENV PATH="${PATH}:/out/usr/bin:/out/usr/local/bin"