Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tensorflow_serving/tools/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG TF_SERVING_VERSION=latest
ARG TF_SERVING_BUILD_IMAGE=tensorflow/serving:${TF_SERVING_VERSION}-devel

FROM ${TF_SERVING_BUILD_IMAGE} as build_image
FROM ubuntu:20.04
FROM ubuntu:22.04

ARG TF_SERVING_VERSION_GIT_BRANCH=master
ARG TF_SERVING_VERSION_GIT_COMMIT=head
Expand Down
9 changes: 5 additions & 4 deletions tensorflow_serving/tools/docker/Dockerfile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
Copy link

@floringavrila floringavrila Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you tried to build this docker file ?
you could use python version 3.10 which comes installed on ubuntu 22

I do not think python 3.9 is available on ppa:deadsnakes/ppa. for ubuntu 22 ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't and I see there are some issues with the build. I'll try to figure that out

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@floringavrila I have updated the Dockerfile and was able to build it now

# limitations under the License.
FROM ubuntu:20.04 as base_build
FROM ubuntu:22.04 as base_build

ARG TF_SERVING_VERSION_GIT_BRANCH=master
ARG TF_SERVING_VERSION_GIT_COMMIT=HEAD
Expand All @@ -25,6 +25,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
automake \
build-essential \
ca-certificates \
gnupg \
curl \
git \
gcc-10 \
Expand All @@ -35,10 +36,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libtool \
libzmq3-dev \
mlocate \
openjdk-8-jdk\
openjdk-8-jre-headless \
openjdk-11-jdk\
openjdk-11-jre-headless \
pkg-config \
python-dev \
python3-dev \
software-properties-common \
swig \
unzip \
Expand Down
31 changes: 13 additions & 18 deletions tensorflow_serving/tools/docker/Dockerfile.devel-gpu
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM nvidia/cuda:12.2.0-base-ubuntu20.04 as base_build
FROM nvidia/cuda:12.2.0-base-ubuntu22.04 as base_build

ARG TF_SERVING_VERSION_GIT_BRANCH=master
ARG TF_SERVING_VERSION_GIT_COMMIT=HEAD
Expand Down Expand Up @@ -75,32 +75,27 @@ RUN apt-get install -y --no-install-recommends \
libcurl3-dev \
libzmq3-dev \
mlocate \
openjdk-8-jdk\
openjdk-8-jre-headless \
openjdk-11-jdk\
openjdk-11-jre-headless \
pkg-config \
python-dev \
software-properties-common \
swig \
unzip \
wget \
zip \
zlib1g-dev \
python3-distutils \
python-distutils-extra && \
zlib1g-dev && \
find /usr/local/cuda-12.2/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete


# Install python 3.9.
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && apt-get install -y \
python3.9 python3.9-dev python3-pip python3.9-venv && \
# Install python 3.10.
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 python3-dev python3-pip python3-venv && \
rm -rf /var/lib/apt/lists/* && \
python3.9 -m pip install pip --upgrade && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 0
python3 -m pip install --upgrade pip && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

# Make python3.9 the default python version
# Make python3.10 the default python version
# If updating default python version, also update version in the WORKSPACE file.
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 0
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1

RUN curl -fSsL -O https://bootstrap.pypa.io/get-pip.py && \
python3 get-pip.py && \
Expand Down Expand Up @@ -159,7 +154,7 @@ RUN echo "Building with Bazel options: ${TF_SERVING_BAZEL_OPTIONS}"

RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:${LD_LIBRARY_PATH} \
bazel build --color=yes --curses=yes --config=cuda_clang --copt="-fPIC"\
bazel build --color=yes --curses=yes --config=cuda_clang --copt="-fPIC" --local_ram_resources=32768 --local_cpu_resources=8 \
${TF_SERVING_BAZEL_OPTIONS} \
--verbose_failures \
--output_filter=DONT_MATCH_ANYTHING \
Expand All @@ -170,7 +165,7 @@ RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/lib
rm /usr/local/cuda/lib64/stubs/libcuda.so.1

# Build and install TensorFlow Serving API
RUN bazel build --color=yes --curses=yes \
RUN bazel build --color=yes --curses=yes --local_ram_resources=32768 --local_cpu_resources=8 \
${TF_SERVING_BAZEL_OPTIONS} \
--verbose_failures \
--output_filter=DONT_MATCH_ANYTHING \
Expand Down
6 changes: 3 additions & 3 deletions tensorflow_serving/tools/docker/Dockerfile.devel-mkl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:20.04 as base_build
FROM ubuntu:22.04 as base_build

ARG TF_SERVING_VERSION_GIT_BRANCH=master
ARG TF_SERVING_VERSION_GIT_COMMIT=HEAD
Expand Down Expand Up @@ -42,8 +42,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libtool \
libzmq3-dev \
mlocate \
openjdk-8-jdk\
openjdk-8-jre-headless \
openjdk-11-jdk\
openjdk-11-jre-headless \
pkg-config \
software-properties-common \
swig \
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_serving/tools/docker/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG TF_SERVING_VERSION=latest
ARG TF_SERVING_BUILD_IMAGE=tensorflow/serving:${TF_SERVING_VERSION}-devel-gpu

FROM ${TF_SERVING_BUILD_IMAGE} as build_image
FROM nvidia/cuda:12.2.0-base-ubuntu20.04 as base_build
FROM nvidia/cuda:12.2.0-base-ubuntu22.04 as base_build

ARG TF_SERVING_VERSION_GIT_BRANCH=master
ARG TF_SERVING_VERSION_GIT_COMMIT=HEAD
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_serving/tools/docker/Dockerfile.mkl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG TF_SERVING_VERSION=latest
ARG TF_SERVING_BUILD_IMAGE=tensorflow/serving:${TF_SERVING_VERSION}-devel-mkl

FROM ${TF_SERVING_BUILD_IMAGE} as build_image
FROM ubuntu:20.04
FROM ubuntu:22.04

ARG TF_SERVING_VERSION_GIT_BRANCH=master
ARG TF_SERVING_VERSION_GIT_COMMIT=head
Expand Down
8 changes: 4 additions & 4 deletions tensorflow_serving/tools/docker/setup.sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ cat >/etc/apt/sources.list.d/custom.list <<SOURCES
deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /

# More Python versions: Deadsnakes
deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal main
deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal main
deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main
deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main

# LLVM/Clang repository
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
SOURCES

apt-get update