Skip to content

Commit 29020d0

Browse files
committed
docker image for spark
1 parent 328e51e commit 29020d0

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

docker/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM ubuntu:16.04
2+
3+
# Pick up some TF dependencies
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
build-essential \
6+
curl \
7+
libfreetype6-dev \
8+
libpng12-dev \
9+
libzmq3-dev \
10+
pkg-config \
11+
python \
12+
python-dev \
13+
rsync \
14+
software-properties-common \
15+
unzip \
16+
openjdk-8-jdk \
17+
openjdk-8-jre-headless \
18+
&& \
19+
apt-get clean && \
20+
rm -rf /var/lib/apt/lists/*
21+
22+
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
23+
24+
# Please don't set DEBIAN_FRONTEND.
25+
# Checkout "Why is DEBIAN_FRONTEND=noninteractive discouraged in Dockerfiles?"
26+
# from https://docs.docker.com/engine/faq/ for details.
27+
# ENV DEBIAN_FRONTEND noninteractive
28+
29+
RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
30+
python get-pip.py && \
31+
rm get-pip.py
32+
33+
RUN pip --no-cache-dir install \
34+
Pillow \
35+
h5py \
36+
numpy \
37+
pandas \
38+
scipy \
39+
sklearn \
40+
ipython \
41+
pyspark
42+
43+
# Install TensorFlow CPU verion from central
44+
RUN pip --no-cache-dir install \
45+
'http://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.head-cp27-cp27mu-linux_x86_64.whl'
46+
47+
ENV SPARK_WORKER_PORT 8888
48+
49+
EXPOSE 4040 6066 7077 8080 8888
50+
51+
# Avoid the default Docker behavior of mapping our IP address to an unreachable host name
52+
53+
RUN mkdir -p /phi9t
54+
COPY entrypoint.sh /phi9t/.
55+
56+
WORKDIR /workspace
57+
58+
ENTRYPOINT ["/phi9t/entrypoint.sh"]

docker/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
IP_ADDR="$(ip -o -4 addr list eth0 | perl -n -e 'if (m{inet\s([\d\.]+)\/\d+\s}xms) { print $1 }')"
4+
echo "Container IP Address: $IP_ADDR"
5+
#export MASTER="spark://${IP_ADDR}:7077"
6+
export SPARK_LOCAL_IP="${IP_ADDR}"
7+
export SPARK_PUBLIC_DNS="${IP_ADDR}"
8+
9+
umount /etc/hosts
10+
11+
exec ipython -i $@

0 commit comments

Comments
 (0)