Skip to content

Commit e751f69

Browse files
committed
Make Arch CUDA image smaller
1 parent 42dc92d commit e751f69

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

Dockerfiles/archlinux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ COPY . tensorflow_cc
66
# RUN git clone https://github.com/FloopCZ/tensorflow_cc.git
77

88
# build and install
9-
RUN ./tensorflow_cc/Dockerfiles/install-archlinux.sh --shared
9+
RUN ./tensorflow_cc/Dockerfiles/install-archlinux.sh

Dockerfiles/archlinux-cuda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ COPY . tensorflow_cc
66
# RUN git clone https://github.com/FloopCZ/tensorflow_cc.git
77

88
# build and install
9-
RUN ./tensorflow_cc/Dockerfiles/install-archlinux.sh --cuda --shared
9+
RUN ./tensorflow_cc/Dockerfiles/install-archlinux.sh --cuda
1010

1111
ENV NVIDIA_VISIBLE_DEVICES all
1212
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility

Dockerfiles/install-archlinux.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pacman -Syu --noconfirm --needed \
2424
wget
2525

2626
pacman -S --noconfirm --needed \
27-
java-environment=8 \
27+
jdk11-openjdk \
2828
libarchive \
2929
protobuf \
3030
unzip \
@@ -41,6 +41,7 @@ if $cuda; then
4141
cuda \
4242
cudnn \
4343
nccl
44+
source /etc/profile.d/cuda.sh
4445
fi
4546

4647
# when building TF with Intel MKL support, `locate` database needs to exist
@@ -54,4 +55,15 @@ if $cuda; then
5455
rm -vf /usr/bin/nvidia*
5556
rm -vf /usr/lib/libnvidia*
5657
rm -vf /usr/lib/libcuda*
58+
rm -rvf /opt/cuda/doc/
59+
rm -rvf /opt/cuda/extras/
60+
rm -rvf /opt/cuda/*nsight*
61+
rm -rvf /opt/cuda/*nvvp*
62+
rm -rvf /opt/cuda/samples/
5763
fi
64+
65+
# cleanup packages
66+
rm -rvf /usr/local/lib/bazel/
67+
rm -vf /usr/local/bin/bazel
68+
pacman --noconfirm -R jdk11-openjdk python python-numpy
69+
pacman --noconfirm -Rns $(pacman -Qtdq)

Dockerfiles/ubuntu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ COPY . tensorflow_cc
66
# RUN git clone https://github.com/FloopCZ/tensorflow_cc.git
77

88
# build and install
9-
RUN ./tensorflow_cc/Dockerfiles/install-ubuntu.sh --shared
9+
RUN ./tensorflow_cc/Dockerfiles/install-ubuntu.sh

Dockerfiles/ubuntu-cuda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ COPY . tensorflow_cc
99
# temporarily use the CUDA stubs, the real libraries will be provided by nvidia-docker
1010
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
1111
&& LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs/:$LD_LIBRARY_PATH \
12-
./tensorflow_cc/Dockerfiles/install-ubuntu.sh --shared --cuda \
12+
./tensorflow_cc/Dockerfiles/install-ubuntu.sh --cuda \
1313
&& rm /usr/local/cuda/lib64/stubs/libcuda.so.1

0 commit comments

Comments
 (0)