Skip to content

Commit c5c0cc8

Browse files
authored
build: RHEL8 PyTorch Backend (#266)
* Support RHEL builds
1 parent a0cd50d commit c5c0cc8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tools/gen_ort_dockerfile.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,37 @@ def dockerfile_for_linux(output_file):
9494
# The Onnx Runtime dockerfile is the collection of steps in
9595
# https://github.com/microsoft/onnxruntime/tree/master/dockerfiles
9696
97+
"""
98+
# Consider moving rhel logic to its own function e.g., dockerfile_for_rhel
99+
# if the changes become more substantial.
100+
if target_platform() == "rhel":
101+
df += """
102+
# The manylinux container defaults to Python 3.7, but some feature installation
103+
# requires a higher version.
104+
ARG PYVER=3.10
105+
ENV PYTHONPATH=/opt/python/v
106+
RUN ln -sf /opt/python/cp${PYVER/./}* ${PYTHONPATH}
107+
108+
ENV PYBIN=${PYTHONPATH}/bin
109+
ENV PYTHON_BIN_PATH=${PYBIN}/python${PYVER} \
110+
PATH=${PYBIN}:${PATH}
111+
112+
RUN yum install -y \
113+
wget \
114+
zip \
115+
ca-certificates \
116+
curl \
117+
patchelf \
118+
python3-pip \
119+
git \
120+
gnupg \
121+
gnupg1 \
122+
openssl-devel
123+
124+
"""
125+
else:
126+
df += """
127+
97128
RUN apt-get update && apt-get install -y --no-install-recommends \
98129
software-properties-common \
99130
wget \

0 commit comments

Comments
 (0)