This commit is contained in:
2025-12-13 21:16:37 +00:00
parent 9511a0784c
commit 1a44726c4f
4 changed files with 146 additions and 0 deletions

50
Dockerfile Normal file
View File

@ -0,0 +1,50 @@
# Use the development container, which includes necessary CUDA libraries and the CUDA Compiler.
FROM nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04
# could this be a better base image? pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime
# Set system variables
ENV DEBIAN_FRONTEND=noninteractive
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
ENV CUDA_HOME=/usr/local/cuda
ENV PATH="$CUDA_HOME/bin:$PATH"
ENV LD_LIBRARY_PATH="$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
# Ensure Python outputs everything that's printed inside the application
# (solvws the issue of not seeing the output of the application in the container)
ENV PYTHONUNBUFFERED=1
# Dynamic memory allocation for PyTorch in order to reduce memory fragmentation.
# (reduces risk of OOM eerors in low VRAM scenarios)
ENV PYTORCH_CUDA_ALLOC_CONF="expandable_segments:True"
# Software configuration
ENV PINOKIO_DOWNLOAD_URL=https://github.com/pinokiocomputer/pinokio/releases/download/v5.1.10/Pinokio_5.1.10_amd64.deb
# Install system dependencies required by Pinokio and VNC
RUN apt update \
&& apt install -y \
wget git xdg-utils \
libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 \
libatspi2.0-0 libsecret-1-0 libappindicator3-1 \
libgbm1 libasound2 \
xvfb \
dbus dbus-x11 \
libcudnn8 \
&& rm -rf /var/lib/apt/lists/*
# Download and install the Pinokio .deb package
RUN wget -O pinokio.deb $PINOKIO_DOWNLOAD_URL
RUN apt install -y ./pinokio.deb && rm pinokio.deb
# Folder structures and assets
RUN mkdir /app
WORKDIR /app
COPY config.json config.json
COPY startup.sh startup.sh
RUN chmod +x startup.sh
EXPOSE 42000
CMD ["./startup.sh"]

38
README_ORIGINAL.md Normal file
View File

@ -0,0 +1,38 @@
# Pinokio 3.6 - AI Market Place for Running AI Models in Your Own Privacy
Pinokio [https://pinokio.computer] is the go-to app for downloading and installing the latest AI applications locally on your own hardware. This app is a containerized version of Pinokio, which lets you run everything inside a container - no installation required.
This might seem unusual at first, as Pinokio was originally designed as a desktop app. However, if you have a Linux server with an expensive GPU, where there is no interactive login, this might be an interesting option. Alternatively, if you don't have an expensive GPU but want to try AI apps on a rented GPU in the cloud without dealing with VM configuration, this could also be appealing. Additionally, if you want to experiment with unverified community scripts with the latest innovations but are unsure of their effects on your computer, the container provides an additional layer of isolation.
With Pinokio, downloading and installing AI apps is straightforward. Pinokio will handle that for you, keeping everything in the container to maintain a clean server and workstation.
**NOTE**: The container only contains Pinokio and does not include any AI software or models. Once you open Pinokio, you can browse the Pinokio catalog and let it download the required artifacts into the container.
**NOTE**: All downloads are stored in the `/workspace` folder. To avoid downloading the same files repeatedly, you can map that folder as a volume to your host file system. This is advisable as you will accumulate hundreds of gigabytes of data.
**NOTE**: Pinokio listens on port 42000, but installed apps may listen on other ports. To simplify things, you can expose the container on the host network directly, allowing you to start new apps without reconfiguring port maps.
**NOTE**: Some apps require specific hardware, such as a sound card or microphone. This may be problematic if Pinokio runs on a server in a data center while you access it via a web browser. This limitation affects apps with server-side hardware requirements, potentially rendering them unusable.
For an overview of how Pinokio works and what AI apps can be installed, please refer to the official [Pinokio](https://pinokio.computer) website.
## Building the Container
To build the container, run:
```bash
docker build -t olilanz/ai-pinokio3 .
```
## Running the Container
To run the container, use:
```bash
docker run -it --rm --name ai-pinokio3 \
--shm-size 24g --gpus all \
-v /mnt/cache/appdata/ai-pinokio3:/workspace \
-p 42000:42000 \
--network host \
olilanz/ai-pinokio3
```
## Resources
* [Pinokio GitHub Issues](https://github.com/pinokiocomputer/pinokio/issues/87)
* [Pinokio GitHub Issues](https://github.com/pinokiocomputer/pinokio/issues/238)

5
config.json Normal file
View File

@ -0,0 +1,5 @@
{
"theme": "dark",
"home": "/workspace/data",
"version": "3.6.0"
}

53
startup.sh Normal file
View File

@ -0,0 +1,53 @@
#!/bin/bash
echo "🔧 Starting Pinokio container startup script..."
# Ensure /run/dbus exists
mkdir -p /run/dbus
# Start the system D-Bus daemon (needed by Electron)
echo "🔄 Starting system D-Bus..."
dbus-daemon --system --fork
sleep 2 # Give it time to initialize
echo "✅ System D-Bus started."
# Start the session D-Bus (needed by Electron)
echo "🔄 Starting session D-Bus..."
eval $(dbus-launch --sh-syntax)
export DBUS_SESSION_BUS_ADDRESS
echo "✅ Session D-Bus started: $DBUS_SESSION_BUS_ADDRESS"
# Start X virtual framebuffer (needed by Pinokio)
echo "🔄 Starting Xvfb virtual display so Electron has a place to render..."
Xvfb :99 -screen 0 1280x1024x16 &
sleep 2
export DISPLAY=:99
echo "✅ Xvfb is running (DISPLAY=:99)."
# Setting up the cache directories
CACHE_HOME="/workspace"
CONFIG_HOME="${CACHE_HOME}/config"
PINOKIO_HOME="${CACHE_HOME}/data"
echo "📂 Setting up cache directories..."
mkdir -p "${CACHE_HOME}" "${CONFIG_HOME}" "${PINOKIO_HOME}"
# Setting up initial config
if [ ! -f "${CONFIG_HOME}/config.json" ]; then
cp "./config.json" "${CONFIG_HOME}/config.json"
fi
# Redirecting the config to the cache
mkdir -p "${CONFIG_HOME}" /root/.config
ln -snf "${CONFIG_HOME}" /root/.config/Pinokio
# Start Pinokio (Electron desktop app requires these switches)
# PINOKIO_ARGS="serve --port 42000 --no-sandbox --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage --headless"
PINOKIO_ARGS="serve --port 42000 --no-sandbox --disable-dev-shm-usage --headless"
echo "🚀 Starting Pinokio (container port 42000)..."
echo "exec pinokio ${PINOKIO_ARGS} 2>&1 | tee \"${CACHE_HOME}/output.log\""
exec pinokio ${PINOKIO_ARGS} 2>&1 | tee "${CACHE_HOME}/output.log"
# If Pinokio exits, print a message
echo "❌ Pinokio has stopped running. Check logs for details."