Skip to content
This repository was archived by the owner on Jan 10, 2020. It is now read-only.

Commit cfbc5df

Browse files
markus1189markusjura
authored andcommitted
Extract install step of tools and initialize sbt plus compiler-bridge (#8)
1 parent e79a36c commit cfbc5df

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

Dockerfile

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# - AWS CLI
66
# - Docker
77

8-
98
# Pull base image
109
FROM openjdk:8u222
1110

@@ -15,10 +14,18 @@ ENV SBT_VERSION=1.2.8
1514
ENV KUBECTL_VERSION=v1.14.5
1615
ENV HOME=/config
1716

17+
# Install some tools
18+
RUN \
19+
apt-get update && apt-get install -y --no-install-recommends \
20+
bash ca-certificates coreutils curl gawk git grep groff gzip \
21+
jq less python sed tar zip software-properties-common apt-transport-https && \
22+
apt-get clean && \
23+
rm -rf /var/lib/apt/lists/* && \
24+
1825
# Install Scala
1926
## Piping curl directly in tar
2027
ENV PATH="/root/scala-$SCALA_VERSION/bin:${PATH}"
21-
SHELL ["/bin/bash", "-o", "pipefail", "-x", "-c"]
28+
SHELL ["/bin/bash", "-eo", "pipefail", "-x", "-c"]
2229
RUN \
2330
curl -fsL https://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
2431
scala -version
@@ -30,20 +37,21 @@ RUN \
3037
rm sbt-$SBT_VERSION.deb && \
3138
apt-get update && \
3239
apt-get install -y --no-install-recommends sbt=${SBT_VERSION} && \
33-
sbt sbtVersion && \
40+
export TEMP="$(mktemp -d)" && \
41+
cd "${TEMP}" && \
42+
echo "class Question { def answer = 42 }" > Question.scala && \
43+
sbt "set scalaVersion := \"${SCALA_VERSION}\"" compile && \
44+
rm -r "${TEMP}" && \
3445
apt-get clean && \
3546
rm -rf /var/lib/apt/lists/*
3647

3748
# Install the AWS CLI
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 && \
40-
curl -sSL https://s3.amazonaws.com/aws-cli/awscli-bundle.zip -o awscli-bundle.zip && \
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 && \
45-
rm awscli-bundle.zip && \
46-
rm -Rf awscli-bundle
49+
RUN \
50+
curl -sSL https://s3.amazonaws.com/aws-cli/awscli-bundle.zip -o awscli-bundle.zip && \
51+
unzip awscli-bundle.zip && \
52+
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws && \
53+
rm awscli-bundle.zip && \
54+
rm -Rf awscli-bundle
4755

4856
# Install kubectl
4957
# Note: Latest version may be found on:
@@ -61,11 +69,9 @@ RUN \
6169

6270
# Install Docker
6371
RUN \
64-
apt-get update && apt-get install -y --no-install-recommends software-properties-common apt-transport-https && \
6572
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | apt-key add - && \
6673
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 && \
74+
apt-get update && apt-get install -y --no-install-recommends docker-ce && \
6975
apt-get clean && \
7076
rm -rf /var/lib/apt/lists/*
7177

0 commit comments

Comments
 (0)