-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
126 lines (111 loc) · 5.46 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
#
# Docker + Scala and sbt Dockerfile
# for building a Scala project on AWS CodeBuild
#
# https://github.com/diversit/aws-codebuild-scala-sbt
#
# Based on: aws-codebuild-docker-images for ubuntu/java/openjdk
# See https://github.com/aws/aws-codebuild-docker-images/blob/master/ubuntu/java/openjdk-8/Dockerfile
#
FROM ubuntu:14.04.5
ENV DOCKER_BUCKET="download.docker.com" \
DOCKER_VERSION="17.09.0-ce" \
DOCKER_CHANNEL="stable" \
DOCKER_SHA256="a9e90a73c3cdfbf238f148e1ec0eaff5eb181f92f35bdd938fd7dab18e1c4647" \
DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" \
DOCKER_COMPOSE_VERSION="1.16.1"
# Building git from source code:
# Ubuntu's default git package is built with broken gnutls. Rebuild git with openssl.
##########################################################################
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
wget=1.15-* python=2.7.5-* python2.7-dev=2.7.6-* fakeroot=1.20-* ca-certificates \
tar=1.27.1-* gzip=1.6-* zip=3.0-* autoconf=2.69-* automake=1:1.14.1-* \
bzip2=1.0.6-* file=1:5.14-* g++=4:4.8.2-* gcc=4:4.8.2-* imagemagick=8:6.7.7.10-* \
libbz2-dev=1.0.6-* libc6-dev=2.19-* libcurl4-openssl-dev=7.35.0-* libdb-dev=1:5.3.21~* \
libevent-dev=2.0.21-stable-* libffi-dev=3.1~rc1+r3.0.13-* libgeoip-dev=1.6.0-* libglib2.0-dev=2.40.2-* \
libjpeg-dev=8c-* libkrb5-dev=1.12+dfsg-* liblzma-dev=5.1.1alpha+20120614-* \
libmagickcore-dev=8:6.7.7.10-* libmagickwand-dev=8:6.7.7.10-* libmysqlclient-dev=5.5.59-* \
libncurses5-dev=5.9+20140118-* libpng12-dev=1.2.50-* libpq-dev=9.3.21-* libreadline-dev=6.3-* \
libsqlite3-dev=3.8.2-* libssl-dev=1.0.1f-* libtool=2.4.2-* libwebp-dev=0.4.0-* \
libxml2-dev=2.9.1+dfsg1-* libxslt1-dev=1.1.28-* libyaml-dev=0.1.4-* make=3.81-* \
patch=2.7.1-* xz-utils=5.1.1alpha+20120614-* zlib1g-dev=1:1.2.8.dfsg-* unzip=6.0-* curl=7.35.0-* \
e2fsprogs=1.42.9-* iptables=1.4.21-* xfsprogs=3.1.9ubuntu2 xz-utils=5.1.1alpha+20120614-* \
&& apt-get install -y -qq less=458-* groff=1.22.2-* \
&& apt-get -qy build-dep git=1:1.9.1 \
&& apt-get -qy install libcurl4-openssl-dev=7.35.0-* git-man=1:1.9.1-* liberror-perl=0.17-* \
&& mkdir -p /usr/src/git-openssl \
&& cd /usr/src/git-openssl \
&& apt-get source git=1:1.9.1 \
&& cd $(find -mindepth 1 -maxdepth 1 -type d -name "git-*") \
&& sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control \
&& sed -i -- '/TEST\s*=\s*test/d' ./debian/rules \
&& dpkg-buildpackage -rfakeroot -b \
&& find .. -type f -name "git_*ubuntu*.deb" -exec dpkg -i \{\} \; \
&& rm -rf /usr/src/git-openssl \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Install Docker
RUN set -x \
&& curl -fSL "https://${DOCKER_BUCKET}/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz \
&& echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - \
&& tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ \
&& rm docker.tgz \
&& docker -v \
# set up subuid/subgid so that "--userns-remap=default" works out-of-the-box
&& addgroup dockremap \
&& useradd -g dockremap dockremap \
&& echo 'dockremap:165536:65536' >> /etc/subuid \
&& echo 'dockremap:165536:65536' >> /etc/subgid \
&& wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \
&& curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/dind /usr/local/bin/docker-compose \
# Ensure docker-compose works
&& docker-compose version
# Install dependencies by all python images equivalent to buildpack-deps:jessie
# on the public repos.
RUN wget "https://bootstrap.pypa.io/get-pip.py" -O /tmp/get-pip.py \
&& python /tmp/get-pip.py \
&& pip install awscli==1.11.157 \
&& rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/*
VOLUME /var/lib/docker
ENV JAVA_VERSION=8 \
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" \
JDK_VERSION="8u141-b15-3~14.04" \
JDK_HOME="/usr/lib/jvm/java-8-openjdk-amd64" \
JRE_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre" \
PROPERTIES_COMMON_VERSIION=0.92.37.8 \
PYTHON_TOOL_VERSION="3.3-*"
# Install Java
RUN apt-get update \
&& apt-get install -y software-properties-common=$PROPERTIES_COMMON_VERSIION \
&& add-apt-repository ppa:openjdk-r/ppa \
&& apt-get update \
&& apt-get -y install python-setuptools=$PYTHON_TOOL_VERSION \
&& apt-get -y install openjdk-$JAVA_VERSION-jdk=$JDK_VERSION \
&& apt-get clean \
# Ensure Java cacerts symlink points to valid location
&& update-ca-certificates -f \
&& rm -fr /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install Scala and sbt
# Env variables
ENV SCALA_VERSION 2.12.4
ENV SBT_VERSION 1.1.1
# Scala expects this file
RUN touch /usr/lib/jvm/java-8-openjdk-amd64/release
# Install Scala
## Piping curl directly in tar
RUN \
curl -fsL https://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
echo >> /root/.bashrc && \
echo "export PATH=~/scala-$SCALA_VERSION/bin:$PATH" >> /root/.bashrc
# Install sbt
RUN \
curl -L -o sbt-$SBT_VERSION.deb https://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb && \
dpkg -i sbt-$SBT_VERSION.deb && \
rm sbt-$SBT_VERSION.deb && \
apt-get update && \
apt-get install sbt && \
sbt sbtVersion
# Define working directory
WORKDIR /root