Skip to content

Commit 11b4a56

Browse files
authored
Merge pull request #2 from pylon/bs-docker-cpu
add cpu dockerfile for the readme example
2 parents e2556ab + d1394e9 commit 11b4a56

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ For docker deployment, see the sample dockerfiles in the docker directory.
3535
Docker for ubuntu can be tested with the following commands.
3636

3737
```bash
38-
docker build -t extensor -f docker/ubuntu.dockerfile .
38+
docker build -t extensor -f docker/ubuntu-cpu.dockerfile .
3939
docker run --rm -it extensor mix test
4040
```
4141

42-
If you have nvidia tools installed, you can test on the GPU by substituting
43-
`nvidia-docker` for `docker` above.
42+
If you have nvidia tools installed, you can test on the GPU by using the
43+
`ubuntu-gpu.dockerfile` and substituting `nvidia-docker` for `docker` above.
4444

4545
## Usage
4646
For a simple example, Extensor can be used to evaluate the Pythagorean

docker/ubuntu-cpu.dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
2+
3+
# install packages
4+
RUN apt-get update -qq && apt-get install -y \
5+
build-essential curl locales
6+
7+
# install tensorflow
8+
RUN curl -L https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.8.0.tar.gz | \
9+
tar -C /usr/local -xz
10+
11+
# install elixir
12+
ENV LANG=en_US.UTF-8 \
13+
LANGUAGE=en_US:en \
14+
LC_ALL=en_US.UTF-8
15+
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
16+
locale-gen
17+
RUN curl https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb > /tmp/erlang-solutions_1.0_all.deb && \
18+
dpkg -i /tmp/erlang-solutions_1.0_all.deb && \
19+
apt-get update -qq && apt-get install -y esl-erlang elixir && \
20+
mix local.rebar --force && \
21+
mix local.hex --force
22+
23+
ADD mix.exs .
24+
ADD c_src ./c_src
25+
ADD lib ./lib
26+
ADD test ./test
27+
RUN mkdir priv
28+
RUN mix deps.get
29+
RUN mix compile
30+
31+
CMD ["iex", "-S", "mix"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ ADD lib ./lib
2626
ADD test ./test
2727
RUN mkdir priv
2828
RUN mix deps.get
29+
RUN mix compile
2930

3031
CMD ["iex", "-S", "mix"]

0 commit comments

Comments
 (0)