-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
221 lines (178 loc) · 7.71 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
ARG FROM_IMAGE=amazonlinux
ARG FROM_TAG=2.0.20200207.1
FROM ${FROM_IMAGE}:${FROM_TAG}
MAINTAINER [email protected]
################ UTILITIES VERSIONS ########################
ARG KUBE_RELEASE_VER=v1.17.3
ARG NODE_VERSION=12.16.2
ARG IAM_AUTH_VER=0.4.0
ARG EKSUSER_VER=0.1.1
ARG KUBECFG_VER=0.9.1
ARG KSONNET_VER=0.13.1
ARG K9S_VER=0.3.0
ARG DOCKER_COMPOSE_VER=1.25.4
ARG KIND_VER=0.8.1
ARG OCTANT_VER=0.10.2
ARG AWSCLI_URL_BASE=awscli.amazonaws.com
ARG AWSCLI_URL_FILE=awscli-exe-linux-x86_64.zip
ARG KUBECTX_VER=0.9.0
ARG KUBENS_VER=0.9.0
ARG BAT_VER=0.15.4
ARG VSCODESERVER_VER=3.3.1
################## SETUP ENV ###############################
### OCTANT
# browser autostart at octant launch is disabled
# ip address and port are modified (to better work with Cloud9)
ENV OCTANT_DISABLE_OPEN_BROWSER=1
ENV OCTANT_LISTENER_ADDR="0.0.0.0:8080"
### NODE
ENV NVM_DIR=/usr/local/nvm
ENV NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
ENV NODE_VERSION=${NODE_VERSION}
### CODE-SERVER
ENV PATH=/usr/local/bin/code-server/bin:$PATH
################## BEGIN INSTALLATION ######################
## This adds the script that checks the version of the tools and utilities installed
ADD utilsversions.sh .
## This will remove intermediate downloads between RUN steps as /tmp is out of the container FS
VOLUME /tmp
WORKDIR /tmp
######################################
## begin setup add-on systems tools ##
######################################
# setup various utils (latest at time of docker build)
# docker is being installed to support DinD scenarios (e.g. for being able to build)
# httpd-tools include the ab tool (for benchmarking http end points)
RUN yum update -y \
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum install -y \
git \
sudo \
httpd-tools \
iputils \
jq \
less \
openssl \
openssl11 \
python3 \
tar \
unzip \
vi \
wget \
which \
procps-ng \
figlet \
&& curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo \
&& yum install -y yarn \
&& yum clean all \
&& rm -rf /var/cache/yum
####################################
## end setup add-on systems tools ##
####################################
########################################
## begin setup runtime pre-requisites ##
########################################
# Node
RUN mkdir -p ${NVM_DIR} \
&& curl -s https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
# setup Typescript (latest at time of docker build)
RUN npm install -g typescript
# setup pip (latest at time of docker build)
RUN curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py
########################################
### end setup runtime pre-requisites ###
########################################
###########################
## begin setup utilities ##
###########################
# setup zsh (shell)
RUN sh -c "$(wget -O- https://raw.githubusercontent.com/deluan/zsh-in-docker/master/zsh-in-docker.sh)"
# setup the aws cli v2 (latest at time of docker build)
RUN curl -Ls "https://${AWSCLI_URL_BASE}/${AWSCLI_URL_FILE}" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
&& ./aws/install \
&& /usr/local/bin/aws --version
# setup the eb cli (latest at time of docker build)
RUN pip install awsebcli --upgrade
# setup the aws cdk cli (latest at time of docker build)
RUN npm i -g aws-cdk
# setup the cdk8s cli (latest at time of docker build)
RUN npm i -g cdk8s-cli
# setup kubectl (latest at time of docker build)
RUN curl -sLO https://storage.googleapis.com/kubernetes-release/release/${KUBE_RELEASE_VER}/bin/linux/amd64/kubectl \
&& chmod +x ./kubectl \
&& mv ./kubectl /usr/local/bin/kubectl
# setup the IAM authenticator for aws (for Amazon EKS)
RUN curl -sLo aws-iam-authenticator https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${IAM_AUTH_VER}/aws-iam-authenticator_${IAM_AUTH_VER}_linux_amd64 \
&& chmod +x ./aws-iam-authenticator \
&& mv ./aws-iam-authenticator /usr/local/bin
# setup Helm (latest at time of docker build)
RUN curl -sLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 \
&& chmod +x get_helm.sh \
&& ./get_helm.sh
# setup eksctl (latest at time of docker build)
RUN curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp \
&& mv -v /tmp/eksctl /usr/local/bin
# setup the eksuser tool
RUN curl -sLo eksuser-linux-amd64.zip https://github.com/prabhatsharma/eksuser/releases/download/v${EKSUSER_VER}/eksuser-linux-amd64.zip \
&& unzip eksuser-linux-amd64.zip \
&& chmod +x ./binaries/linux/eksuser \
&& mv ./binaries/linux/eksuser /usr/local/bin/eksuser
# setup kubecfg
RUN curl -sLo kubecfg https://github.com/ksonnet/kubecfg/releases/download/v${KUBECFG_VER}/kubecfg-linux-amd64 \
&& chmod +x kubecfg \
&& mv kubecfg /usr/local/bin/kubecfg
# setup kubectx
RUN curl -sLo kubectx.tar.gz https://github.com/ahmetb/kubectx/releases/download/v${KUBECTX_VER}/kubectx_v${KUBECTX_VER}_linux_x86_64.tar.gz \
&& tar -xvf kubectx.tar.gz \
&& chmod +x kubectx \
&& mv kubectx /usr/local/bin/kubectx
# setup kubens
RUN curl -sLo kubens.tar.gz https://github.com/ahmetb/kubectx/releases/download/v${KUBENS_VER}/kubens_v${KUBENS_VER}_linux_x86_64.tar.gz \
&& tar -xvf kubens.tar.gz \
&& chmod +x kubens \
&& mv kubens /usr/local/bin/kubens
# setup ksonnet
RUN curl -sLo - https://github.com/ksonnet/ksonnet/releases/download/v${KSONNET_VER}/ks_${KSONNET_VER}_linux_amd64.tar.gz |tar xfz - --strip-components=1 \
&& mv ks /usr/bin/ks
# setup k9s
RUN curl -sLo - https://github.com/derailed/k9s/releases/download/${K9S_VER}/k9s_${K9S_VER}_Linux_x86_64.tar.gz |tar xfz - \
&& mv k9s /usr/local/bin/k9s
# setup docker
RUN amazon-linux-extras install docker -y
# setup docker-compose
RUN curl -sL "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VER}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose
# setup kind
RUN curl -Lo ./kind https://kind.sigs.k8s.io/dl/v${KIND_VER}/kind-linux-amd64 \
&& chmod +x ./kind \
&& mv ./kind /usr/local/bin/kind
# setup Octant
RUN curl -sLo - https://github.com/vmware-tanzu/octant/releases/download/v${OCTANT_VER}/octant_${OCTANT_VER}_Linux-64bit.tar.gz |tar xfz - --strip-components=1 \
&& mv octant /usr/local/bin/octant
# setup glooctl
RUN curl -sL https://run.solo.io/gloo/install | sh \
&& mv $HOME/.gloo/bin/glooctl /usr/local/bin \
&& rm -r $HOME/.gloo
# setup bat
RUN curl -sSL https://github.com/sharkdp/bat/releases/download/v${BAT_VER}/bat-v${BAT_VER}-x86_64-unknown-linux-gnu.tar.gz | tar xfz - \
&& mv ./bat-v${BAT_VER}-x86_64-unknown-linux-gnu/bat /usr/local/bin
# setup VS Code server
RUN curl -sSL https://github.com/cdr/code-server/releases/download/v${VSCODESERVER_VER}/code-server-${VSCODESERVER_VER}-linux-amd64.tar.gz | tar xfz - \
&& mv code-server-${VSCODESERVER_VER}-linux-amd64 /usr/local/bin/code-server
#########################
## end setup utilities ##
#########################
##################### INSTALLATION END #####################
WORKDIR /
############################################################
########### Tools and Utilities versions checks ############
############################################################
RUN /utilsversions.sh
CMD /bin/sh