@@ -4,6 +4,8 @@ ARG BASE_IMAGE=ubuntu:22.04
44# extras or core
55FROM ${BASE_IMAGE} as requirements-core
66
7+ USER root
8+
79ARG GO_VERSION=1.21.7
810ARG BUILD_TYPE
911ARG CUDA_MAJOR_VERSION=11
@@ -21,7 +23,7 @@ RUN apt-get update && \
2123 apt-get install -y ca-certificates curl patch pip cmake git && apt-get clean
2224
2325# Install Go
24- RUN curl -L -s https://go.dev/dl/go$GO_VERSION.linux-$TARGETARCH.tar.gz | tar -v - C /usr/local -xz
26+ RUN curl -L -s https://go.dev/dl/go$GO_VERSION.linux-$TARGETARCH.tar.gz | tar -C /usr/local -xz
2527ENV PATH $PATH:/usr/local/go/bin
2628
2729COPY --chmod=644 custom-ca-certs/* /usr/local/share/ca-certificates/
@@ -79,6 +81,10 @@ RUN pip install --upgrade pip
7981RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
8082RUN apt-get install -y espeak-ng espeak && apt-get clean
8183
84+ RUN if [ ! -e /usr/bin/python ]; then \
85+ ln -s /usr/bin/python3 /usr/bin/python \
86+ ; fi
87+
8288# ##################################
8389# ##################################
8490
@@ -166,43 +172,43 @@ COPY --from=builder /build/backend-assets/grpc/stablediffusion ./backend-assets/
166172
167173# # Duplicated from Makefile to avoid having a big layer that's hard to push
168174RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
169- PATH=$PATH:/opt/conda/bin make -C backend/python/autogptq \
175+ make -C backend/python/autogptq \
170176 ; fi
171177RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
172- PATH=$PATH:/opt/conda/bin make -C backend/python/bark \
178+ make -C backend/python/bark \
173179 ; fi
174180RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
175- PATH=$PATH:/opt/conda/bin make -C backend/python/diffusers \
181+ make -C backend/python/diffusers \
176182 ; fi
177183RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
178- PATH=$PATH:/opt/conda/bin make -C backend/python/vllm \
184+ make -C backend/python/vllm \
179185 ; fi
180186RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
181- PATH=$PATH:/opt/conda/bin make -C backend/python/mamba \
187+ make -C backend/python/mamba \
182188 ; fi
183189RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
184- PATH=$PATH:/opt/conda/bin make -C backend/python/sentencetransformers \
190+ make -C backend/python/sentencetransformers \
185191 ; fi
186192RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
187- PATH=$PATH:/opt/conda/bin make -C backend/python/transformers \
193+ make -C backend/python/transformers \
188194 ; fi
189195RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
190- PATH=$PATH:/opt/conda/bin make -C backend/python/vall-e-x \
196+ make -C backend/python/vall-e-x \
191197 ; fi
192198RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
193- PATH=$PATH:/opt/conda/bin make -C backend/python/exllama \
199+ make -C backend/python/exllama \
194200 ; fi
195201RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
196- PATH=$PATH:/opt/conda/bin make -C backend/python/exllama2 \
202+ make -C backend/python/exllama2 \
197203 ; fi
198204RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
199- PATH=$PATH:/opt/conda/bin make -C backend/python/petals \
205+ make -C backend/python/petals \
200206 ; fi
201207RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
202- PATH=$PATH:/opt/conda/bin make -C backend/python/transformers-musicgen \
208+ make -C backend/python/transformers-musicgen \
203209 ; fi
204210RUN if [ "${IMAGE_TYPE}" = "extras" ]; then \
205- PATH=$PATH:/opt/conda/bin make -C backend/python/coqui \
211+ make -C backend/python/coqui \
206212 ; fi
207213
208214# Make sure the models directory exists
0 commit comments