Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 51393cf

Browse files
authored
Add a DockerFile to the repository. (#142)
1 parent 336c363 commit 51393cf

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docker/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# TODO: We should have a job that creates a S4TF base image so that
2+
# we don't have to duplicate the installation everywhere.
3+
FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu18.04
4+
5+
# Allows the caller to specify the toolchain to use.
6+
ARG swift_tf_url=https://storage.googleapis.com/s4tf-kokoro-artifact-testing/latest/swift-tensorflow-DEVELOPMENT-ubuntu18.04.tar.gz
7+
8+
# Install Swift deps.
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
build-essential \
12+
ca-certificates \
13+
curl \
14+
git \
15+
python \
16+
python-dev \
17+
python-pip \
18+
python-setuptools \
19+
python-tk \
20+
python3 \
21+
python3-pip \
22+
python3-setuptools \
23+
clang \
24+
libcurl4-openssl-dev \
25+
libicu-dev \
26+
libpython-dev \
27+
libpython3-dev \
28+
libncurses5-dev \
29+
libxml2 \
30+
libblocksruntime-dev
31+
32+
# Configure cuda
33+
RUN echo "/usr/local/cuda-9.2/targets/x86_64-linux/lib/stubs" > /etc/ld.so.conf.d/cuda-9.2-stubs.conf && \
34+
ldconfig
35+
36+
# Download and extract S4TF
37+
WORKDIR /swift-tensorflow-toolchain
38+
RUN curl -fSsL $swift_tf_url -o swift.tar.gz \
39+
&& mkdir usr \
40+
&& tar -xzf swift.tar.gz --directory=usr --strip-components=1 \
41+
&& rm swift.tar.gz
42+
ENV PATH="/swift-tensorflow-toolchain/usr/bin:${PATH}"
43+
44+
WORKDIR /swift-models
45+
COPY . .

0 commit comments

Comments
 (0)