Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.venv
41 changes: 41 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive
# Set PATH and LD_PRELOAD so that uv and the preloading are set system-wide.
ENV PATH="/root/.local/bin:${PATH}"
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6"

# Install system tools, enable Universe repository, and install X11/GL dependencies.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
curl \
git && \
add-apt-repository universe && \
apt-get update && \
apt-get install -y --no-install-recommends \
libx11-6 \
libgl1-mesa-glx \
libglx-mesa0 && \
# Now add the deadsnakes PPA for Python 3.11
add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update && \
apt-get install -y --no-install-recommends \
python3.11 \
python3.11-distutils \
python3.11-dev && \
rm -rf /var/lib/apt/lists/* && \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \
python -m pip install --upgrade pip

WORKDIR /open_duck
# Copy the entire repository; use a proper .dockerignore to exclude unneeded files.
COPY . .

# Install uv, then ensure the uv lockfile exists (create if not) and sync the environment.
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
if [ ! -f uv.lock ]; then uv lock; fi && \
uv sync --frozen

CMD ["bash"]
4 changes: 4 additions & 0 deletions docker/docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
IMAGE_NAME="open_duck"

docker build --network=host -t $IMAGE_NAME -f Dockerfile ..
11 changes: 11 additions & 0 deletions docker/run_docker_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
IMAGE_NAME="open_duck"

# Allow local connections to X server (optional; adjust as needed)
# xhost +local:root

docker run --gpus all --rm -it --network=host \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
-v $(pwd)/../:/open_duck \
$IMAGE_NAME