diff --git a/Dockerfile b/Dockerfile index ec72a1ca..d730d4b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ WORKDIR /build RUN apt-get update && \ apt-get install -y ca-certificates cmake curl +# CuBLAS requirements RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \ apt-get install -y software-properties-common && \ apt-add-repository contrib && \ @@ -30,14 +31,12 @@ RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \ ; fi ENV PATH /usr/local/cuda/bin:${PATH} -RUN if [ "${BUILD_TYPE}" = "openblas" ]; then \ - apt-get install -y libopenblas-dev \ - ; fi +# OpenBLAS requirements +RUN apt-get install -y libopenblas-dev -RUN if [ "${GO_TAGS}" = "stablediffusion" ]; then \ - apt-get install -y libopencv-dev && \ - ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 \ - ; fi +# Stable Diffusion requirements +RUN apt-get install -y libopencv-dev && \ + ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 COPY . . RUN make build diff --git a/Dockerfile.dev b/Dockerfile.dev index ad0c7ead..df44359a 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -15,6 +15,7 @@ WORKDIR /build RUN apt-get update && \ apt-get install -y cmake +# CuBLAS requirements RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \ apt-get install -y software-properties-common && \ apt-add-repository contrib && \ @@ -26,14 +27,12 @@ RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \ ; fi ENV PATH /usr/local/cuda/bin:${PATH} -RUN if [ "${BUILD_TYPE}" = "openblas" ]; then \ - apt-get install -y libopenblas-dev \ - ; fi +# OpenBLAS requirements +RUN apt-get install -y libopenblas-dev -RUN if [ "${GO_TAGS}" = "stablediffusion" ]; then \ - apt-get install -y libopencv-dev && \ - ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 \ - ; fi +# Stable Diffusion requirements +RUN apt-get install -y libopencv-dev && \ + ln -s /usr/include/opencv4/opencv2 /usr/include/opencv2 COPY . . RUN make build @@ -53,6 +52,7 @@ ENV HEALTHCHECK_ENDPOINT=http://localhost:8080/readyz RUN apt-get update && \ apt-get install -y ca-certificates curl +# CuBLAS requirements RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \ apt-get install -y curl software-properties-common && \ apt-add-repository contrib && \ @@ -63,13 +63,11 @@ RUN if [ "${BUILD_TYPE}" = "cublas" ]; then \ apt-get install -y cuda-cudart-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} libcublas-${CUDA_MAJOR_VERSION}-${CUDA_MINOR_VERSION} \ ; fi -RUN if [ "${BUILD_TYPE}" = "openblas" ]; then \ - apt-get install -y libopenblas0 \ - ; fi +# OpenBLAS requirements +RUN apt-get install -y libopenblas0 -RUN if [ "${GO_TAGS}" = "stablediffusion" ]; then \ - apt-get install -y libgomp1 libopencv-core4.5 libopencv-imgcodecs4.5 \ - ; fi +# Stable Diffusion requirements +RUN apt-get install -y libgomp1 libopencv-core4.5 libopencv-imgcodecs4.5 COPY --from=builder /build/local-ai /usr/bin/local-ai