Skip to content

Commit

Permalink
add targetarch env
Browse files Browse the repository at this point in the history
  • Loading branch information
KevDevSha committed May 20, 2024
1 parent 9042b6c commit cb8d6cf
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# CUDA Version
# For a slim CPU-only image, leave the CUDA_VERSION argument blank -- e.g.
# ARG CUDA_VERSION=
ARG CUDA_VERSION=11.3.1
ARG CUDA_VERSION=''

# Can use these to dynamically set the base image using the build matrix in the future.
ARG LINUX_DISTRO='ubuntu'
Expand Down Expand Up @@ -68,10 +68,7 @@ ARG COMPOSER_INSTALL_COMMAND='mosaicml[all]'

FROM ${BASE_IMAGE} AS pytorch_stage

RUN echo "Building for platform: $TARGETPLATFORM" && \
echo "OS: ${TARGETOS}" && \
echo "Architecture: ${TARGETARCH}" && \
echo "Variant: ${TARGETVARIANT}"
ARG TARGETARCH

ARG DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -211,13 +208,11 @@ ARG PILLOW_SIMD_VERSION
COPY pillow_stub /tmp/pillow_stub

RUN if [ "$TARGETARCH" = "amd64" ]; then \
echo "Architecture: ${TARGETARCH}" && \
pip${PYTHON_VERSION} install --no-cache-dir --upgrade /tmp/pillow_stub && \
pip${PYTHON_VERSION} install --no-cache-dir --upgrade pillow_simd==${PILLOW_SIMD_VERSION} && \
rm -rf /tmp/pillow_stub; \
# Install Pillow as arm64 is not supported by pillow-simd,
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "Architecture: ${TARGETARCH}" && \
pip${PYTHON_VERSION} install --no-cache-dir --upgrade Pillow==${PILLOW_PSEUDOVERSION}; \
fi

Expand Down

0 comments on commit cb8d6cf

Please sign in to comment.