Skip to content

Commit 1c4d719

Browse files
committed
Replace m4 template by Dockerfile ARGs
1 parent f34f502 commit 1c4d719

File tree

3 files changed

+38
-35
lines changed

3 files changed

+38
-35
lines changed
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
FROM PADDLE_BASE_IMAGE
2-
MAINTAINER PaddlePaddle Dev Team <paddle-dev@baidu.com>
1+
FROM ubuntu:14.04
2+
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
33

4-
# It is good to run apt-get install with Dockerfile RUN directive,
5-
# because if the following invocation to /root/build.sh fails, `docker
6-
# build` wouldn't have to re-install packages after we fix
7-
# /root/build.sh. For more about Docker build cache, please refer to
8-
# https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/build-cache.
94
RUN apt-get update && \
105
apt-get install -y cmake libprotobuf-dev protobuf-compiler git \
116
libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip \
@@ -16,13 +11,13 @@ RUN apt-get update && \
1611
RUN pip install BeautifulSoup docopt PyYAML pillow \
1712
'sphinx>=1.4.0' sphinx_rtd_theme breathe recommonmark
1813

19-
ENV WITH_GPU=PADDLE_WITH_GPU
20-
ENV WITH_AVX=PADDLE_WITH_AVX
14+
ARG WITH_AVX
15+
ENV WITH_AVX=${WITH_AVX:-ON}
16+
ENV WITH_GPU=OFF
2117

2218
RUN mkdir /paddle
2319
COPY . /paddle/
24-
COPY paddle/scripts/docker/build.sh /root/
25-
RUN /root/build.sh
20+
RUN /paddle/paddle/scripts/docker/build.sh
2621

2722
RUN echo 'export LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH}' >> /etc/profile
2823
RUN pip install /usr/local/opt/paddle/share/wheels/*.whl
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04
2+
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
3+
4+
RUN apt-get update && \
5+
apt-get install -y cmake libprotobuf-dev protobuf-compiler git \
6+
libgoogle-glog-dev libgflags-dev libatlas-dev libatlas3-base g++ m4 python-pip \
7+
python-protobuf python-numpy python-dev swig openssh-server \
8+
wget unzip python-matplotlib tar xz-utils bzip2 gzip coreutils \
9+
sed grep graphviz libjpeg-dev zlib1g-dev doxygen && \
10+
apt-get clean -y
11+
RUN pip install BeautifulSoup docopt PyYAML pillow \
12+
'sphinx>=1.4.0' sphinx_rtd_theme breathe recommonmark
13+
14+
ARG WITH_AVX
15+
ENV WITH_AVX=${WITH_AVX:-ON}
16+
ENV WITH_GPU=ON
17+
18+
RUN mkdir /paddle
19+
COPY . /paddle/
20+
RUN /paddle/paddle/scripts/docker/build.sh
21+
22+
RUN echo 'export LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH}' >> /etc/profile
23+
RUN pip install /usr/local/opt/paddle/share/wheels/*.whl
24+
RUN paddle version # print version after build
25+
26+
# Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service
27+
RUN mkdir /var/run/sshd
28+
RUN echo 'root:root' | chpasswd
29+
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
30+
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
31+
EXPOSE 22
32+
CMD ["/usr/sbin/sshd", "-D"]

paddle/scripts/docker/generate.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)