feat: apt clean

This commit is contained in:
2024-09-10 14:19:34 -07:00
parent 2eddbb0557
commit 476aa7391c
3 changed files with 10 additions and 14 deletions
+5 -9
View File
@@ -7,31 +7,27 @@ ARG PYTHON_VERSION="3.11"
ARG NUMPY_VERSION="1.22.4"
ARG DEBIAN_FRONTEND="noninteractive"
RUN sudo apt-get update && \
sudo apt-get install -y rocm-libs && \
sudo rm -rf /var/lib/apt/lists/*
WORKDIR /home/rocm
# Add GPU target
RUN bash -c 'echo -e "gfx803\ngfx900" | sudo tee /opt/rocm/bin/target.lst'
# Install bazelisk
RUN sudo wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.21.0/bazelisk-linux-amd64 && sudo chmod 755 /usr/local/bin/bazel
WORKDIR /home/rocm
RUN git clone --depth 1 https://github.com/ROCm/tensorflow-upstream.git -b ${TENSORFLOW_BRANCH} tensorflow
WORKDIR /home/rocm/tensorflow
RUN <<EOF
sudo apt-get update
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
EOF
WORKDIR /home/rocm/tensorflow
# TODO: simplify dependencies
# > Ref: https://github.com/ROCm/ROCm/issues/1880
RUN python${PYTHON_VERSION} -m pip install -U --user pip numpy==${NUMPY_VERSION} wheel packaging requests opt_einsum patchelf
@@ -43,7 +39,7 @@ RUN sudo ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python
RUN ./build_rocm_python3 /opt/rocm
WORKDIR /tmp/tensorflow_pkg
RUN cp (ls -l tensorflow*.whl | cut -d' ' -f9 | tr -d '\n') /home/rocm/tensorflow-rocm.whl
RUN cp (ls -l tensorflow*.whl | awk '{ print $9 }' | tail -n1 | tr -d '\n') /home/rocm/tensorflow-rocm.whl
WORKDIR /home/rocm
CMD [ "/bin/bash", "-l" ]