mirror of
https://github.com/BillyOutlast/rocm-automated.git
synced 2026-02-04 03:51:19 +01:00
70 lines
2.0 KiB
Docker
70 lines
2.0 KiB
Docker
FROM rocm/dev-ubuntu-24.04:7.1-complete AS builder
|
|
# vim: filetype=dockerfile
|
|
|
|
ARG GFX_NAME=gfx1151
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y ca-certificates libvulkan1 git \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Clone and build stable-diffusion.cpp
|
|
RUN git clone https://github.com/leejet/stable-diffusion.cpp /stable-diffusion.cpp
|
|
WORKDIR /stable-diffusion.cpp
|
|
RUN git pull origin master && \
|
|
git submodule init && \
|
|
git submodule update
|
|
|
|
RUN mkdir -p build && cd build && \
|
|
cmake .. -G "Ninja" \
|
|
-DCMAKE_C_COMPILER=clang \
|
|
-DCMAKE_CXX_COMPILER=clang++ \
|
|
-DSD_HIPBLAS=ON \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DGPU_TARGETS=$GFX_NAME \
|
|
-DAMDGPU_TARGETS=$GFX_NAME \
|
|
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
|
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON && \
|
|
cmake --build . --config Release
|
|
|
|
|
|
|
|
# Clone sd.cpp-webui and place the binary in its folder as per instructions
|
|
WORKDIR /
|
|
RUN git clone https://github.com/daniandtheweb/sd.cpp-webui.git /sd-webui
|
|
WORKDIR /sd-webui
|
|
|
|
# Copy the compiled sd binary to the webui folder as required
|
|
RUN cp /stable-diffusion.cpp/build/bin/sd /sd-webui/sd
|
|
# Make the launch script executable
|
|
RUN chmod +x sdcpp_webui.sh
|
|
|
|
# Runtime stage
|
|
FROM rocm/dev-ubuntu-24.04:7.1-complete AS runtime
|
|
|
|
|
|
RUN apt install -y python3.13
|
|
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 100
|
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.13 100
|
|
|
|
# Create video group and add proper permissions
|
|
RUN groupadd -g 44 video || true
|
|
|
|
# Copy the complete sd-webui with the binary and installed dependencies
|
|
COPY --from=builder /sd-webui /sd-webui
|
|
|
|
# Set up library paths and working directory
|
|
WORKDIR /sd-webui
|
|
|
|
# Create directories for models and outputs
|
|
RUN mkdir -p /sd-webui/models /sd-webui/outputs
|
|
|
|
WORKDIR /sd-webui
|
|
|
|
|
|
|
|
# Expose web UI port
|
|
EXPOSE 7860
|
|
|
|
# Add startup script that follows the official instructions
|
|
ENTRYPOINT ["./sdcpp_webui.sh", "--autostart", "--listen"] |