55# - AWS CLI
66# - Docker
77
8+
89# Pull base image
910FROM openjdk:8u222
1011
@@ -16,50 +17,57 @@ ENV HOME=/config
1617
1718# Install Scala
1819# # Piping curl directly in tar
20+ ENV PATH="/root/scala-$SCALA_VERSION/bin:${PATH}"
21+ SHELL ["/bin/bash" , "-o" , "pipefail" , "-x" , "-c" ]
1922RUN \
2023 curl -fsL https://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
21- echo >> /root/.bashrc && \
22- echo "export PATH=~/scala-$SCALA_VERSION/bin:$PATH" >> /root/.bashrc
24+ scala -version
2325
2426# Install sbt
2527RUN \
2628 curl -L -o sbt-$SBT_VERSION.deb https://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb && \
2729 dpkg -i sbt-$SBT_VERSION.deb && \
2830 rm sbt-$SBT_VERSION.deb && \
2931 apt-get update && \
30- apt-get install sbt && \
31- sbt sbtVersion
32+ apt-get install -y --no-install-recommends sbt=${SBT_VERSION} && \
33+ sbt sbtVersion && \
34+ apt-get clean && \
35+ rm -rf /var/lib/apt/lists/*
3236
3337# Install the AWS CLI
34- # RUN set -x && \
35- RUN apt-get install -y bash ca-certificates coreutils curl gawk git grep groff gzip jq less python sed tar zip && \
38+ RUN apt-get update && apt-get install -y --no-install-recommends \
39+ bash ca-certificates coreutils curl gawk git grep groff gzip jq less python sed tar zip && \
3640 curl -sSL https://s3.amazonaws.com/aws-cli/awscli-bundle.zip -o awscli-bundle.zip && \
37- unzip awscli-bundle.zip
38- RUN ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws && \
41+ unzip awscli-bundle.zip && \
42+ apt-get clean && \
43+ rm -rf /var/lib/apt/lists/* && \
44+ ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws && \
3945 rm awscli-bundle.zip && \
4046 rm -Rf awscli-bundle
4147
4248# Install kubectl
4349# Note: Latest version may be found on:
4450# https://aur.archlinux.org/packages/kubectl-bin/
45- RUN set -x \
46- && curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl \
47- && mv kubectl /usr/local/bin/kubectl \
48- && chmod +x /usr/local/bin/kubectl
51+ RUN \
52+ curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \
53+ mv kubectl /usr/local/bin/kubectl && \
54+ chmod +x /usr/local/bin/kubectl
4955
50- RUN set -x && \
51- chmod +x /usr/local/bin/kubectl && \
52- \
53- # Create non-root user (with a randomly chosen UID/GUI).
54- adduser kubectl -Du 2342 -h /config && \
55- kubectl version --client
56+ RUN \
57+ chmod +x /usr/local/bin/kubectl && \
58+ # Create non-root user (with a randomly chosen UID/GUI).
59+ adduser kubectl -Du 2342 -h /config && \
60+ kubectl version --client
5661
5762# Install Docker
58- RUN set -x && \
59- apt-get install -y software-properties-common apt-transport-https && \
60- curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID" )/gpg | apt-key add - && \
61- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" && \
62- apt-get update && apt-get install -y docker-ce
63+ RUN \
64+ apt-get update && apt-get install -y --no-install-recommends software-properties-common apt-transport-https && \
65+ curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID" )/gpg | apt-key add - && \
66+ add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" && \
67+ apt-get update && \
68+ apt-get install -y --no-install-recommends docker-ce && \
69+ apt-get clean && \
70+ rm -rf /var/lib/apt/lists/*
6371
6472# Define working directory
6573WORKDIR /root
0 commit comments