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
199 changes: 199 additions & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# Guake Docker Setup

Since Guake is a Linux GTK application, Docker provides the cleanest way to test and run it on macOS.

## Prerequisites

- Docker and Docker Compose installed
- For GUI testing: XQuartz (macOS) or X11 server (Linux)

## Quick Start

### 1. Build the Docker Image
```bash
docker build -t guake:dev -f Dockerfile.dev .
```

### 2. Using Docker Compose (Recommended)
```bash
docker-compose -f docker-compose.dev.yml up

# In another terminal, connect to the container:
docker exec -it guake-dev /bin/bash
```

### 3. Manual Docker Run

#### Linux Users:
```bash
docker run -it --rm \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-e DISPLAY=$DISPLAY \
-v ${PWD}:/guake:rw \
guake:dev /bin/bash
```

#### macOS Users:

First, install and start XQuartz:
```bash
brew install xquartz
open -a XQuartz
```

Configure X11 to accept connections from Docker:
```bash
defaults write org.macosforge.xquartz.X11 nolisten_tcp -boolean false
pkill -9 Xvfb; true
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command looks incorrect for restarting XQuartz: pkill -9 Xvfb; true. Xvfb is typically not used on macOS with XQuartz, and this may do nothing or target an unrelated process. Update this step to restart XQuartz (or document the correct process) so the instructions are actionable.

Suggested change
pkill -9 Xvfb; true
pkill -x XQuartz || true
open -a XQuartz

Copilot uses AI. Check for mistakes.
```

Then run Docker:
```bash
docker run -it --rm \
-e DISPLAY=host.docker.internal:0 \
-v ${PWD}:/guake:rw \
guake:dev /bin/bash
```

Or use socat tunnel:
```bash
# Terminal 1: Start socat
brew install socat
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CONNECT:/tmp/.X11-unix/0 &

# Terminal 2: Run Docker
docker run -it --rm \
-e DISPLAY=host.docker.internal:0 \
-v ${PWD}:/guake:rw \
guake:dev /bin/bash
```

## Inside the Container

### Setup (if not already done)
```bash
cd /guake
make dev
sudo make install-schemas
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside the container instructions use sudo make install-schemas, but the image runs as root by default and does not install sudo, so the command will fail. Suggest using make install-schemas (or explicitly add/install sudo + a non-root user if that’s the intended model).

Suggested change
sudo make install-schemas
make install-schemas

Copilot uses AI. Check for mistakes.
```

### Run Tests
```bash
make test
make test-coverage
```

### Check Code Quality
```bash
make style
make check
```

### Run Guake GUI
```bash
guake &
```

### Build Distribution
```bash
make build
```

### Access Python Shell
```bash
pipenv shell
python3 -c "import guake; print(guake.__version__)"
```

## Image Details

The `Dockerfile.dev` includes:

- **Base:** Ubuntu 22.04 LTS
- **GTK:** GTK 3.0 with VTE terminal widget
- **Tools:** Python 3, pipenv, git, build essentials
- **Locale:** Full locale support
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “Image Details” section claims the Dockerfile provides “Full locale support”, but Dockerfile.dev does not install/configure locales (or run locale-gen). Either add locale setup to the Dockerfile or adjust this bullet so it matches what the image actually contains.

Suggested change
- **Locale:** Full locale support
- **Locale:** Default Ubuntu locale settings

Copilot uses AI. Check for mistakes.
- **D-Bus:** For system communication
- **Development:** All headers and dev libraries

## Common Issues

### "Cannot connect to X server"
- **Linux:** Make sure `/tmp/.X11-unix` exists and is accessible
- **macOS:** Ensure XQuartz is running and X11 forwarding is configured

### "No module named 'gi' (GObject introspection)"
The Dockerfile includes all necessary GObject introspection bindings. If still missing:
```bash
apt-get update && apt-get install -y python3-gi gir1.2-gtk-3.0 gir1.2-vte-2.91
```

### "dbus-launch cannot be run setuid"
This is normal in Docker. DBus operations should still work. Run:
```bash
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
```

### "Permission denied" errors
The container runs as root by default. For safer operation, modify the Dockerfile to create a non-root user.

## Customization

### Use Different Python Version
```bash
docker build -t guake:py39 --build-arg PYTHON_VERSION=3.9 -f Dockerfile.dev .
Comment on lines +143 to +144
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “Use Different Python Version” section suggests building with --build-arg PYTHON_VERSION=..., but Dockerfile.dev does not declare or use an ARG PYTHON_VERSION, so the example won’t have any effect. Either add build-arg support to Dockerfile.dev or adjust the documentation to match the current Dockerfile.

Suggested change
```bash
docker build -t guake:py39 --build-arg PYTHON_VERSION=3.9 -f Dockerfile.dev .
`Dockerfile.dev` does not currently support selecting the Python version via
`--build-arg PYTHON_VERSION=...`. To use a different Python version, update
`Dockerfile.dev` to install the version you need, then rebuild the image:
```bash
docker build -t guake:dev -f Dockerfile.dev .

Copilot uses AI. Check for mistakes.
```

### Add More Tools to Container
Edit `Dockerfile.dev` and add to the `apt-get install` command.

### Persistent Container
```bash
docker run -d --name guake-dev \
-e DISPLAY=$DISPLAY \
-v ${PWD}:/guake:rw \
guake:dev sleep infinity

# Connect whenever needed:
docker exec -it guake-dev /bin/bash
```

## Integration with macOS Development

### Mount Local Code
```bash
docker run -it --rm \
-v ~/Documents/GitHub/guake:/guake:rw \
guake:dev /bin/bash
```

### Use IDE on macOS, Test in Docker
1. Edit code in VS Code/PyCharm on macOS
2. Run tests in Docker:
```bash
docker exec -it guake-dev make test
```

### Access Built Packages from macOS
```bash
docker run -it --rm \
-v ${PWD}/dist:/guake/dist \
guake:dev bash -c "make build && ls -la dist/"
```

## Performance Notes

- First build: ~5 minutes (downloads and installs dependencies)
- Subsequent runs: < 1 second (cached layers)
- Image size: ~1.5 GB
- Container size: ~500 MB when running

## Resources

- Docker documentation: https://docs.docker.com/
- XQuartz (macOS): https://www.xquartz.org/
- GTK3 documentation: https://developer.gnome.org/gtk3/

---

For general development setup, see [SETUP_DEV.md](SETUP_DEV.md)
73 changes: 73 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM ubuntu:22.04

LABEL maintainer="guake"
LABEL description="Guake Terminal Development Container"

# Prevent interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1

# Install system dependencies
RUN apt-get update && apt-get install -y \
# Build tools
build-essential \
python3-dev \
python3-pip \
git \
# GTK and UI libraries
libgtk-3-0 \
libgtk-3-dev \
libvte-2.91-0 \
libvte-2.91-dev \
libkeybinder-3.0-0 \
libkeybinder-3-dev \
# Gettext for translations
gettext \
# D-Bus for communication
dbus \
# X11 and display
libx11-dev \
x11-apps \
x11-utils \
# Additional utilities
curl \
wget \
vim \
less \
# Required for GObject introspection
gir1.2-gtk-3.0 \
gir1.2-vte-2.91 \
gir1.2-glib-2.0 \
libglib2.0-dev \
# GLib schemas
dconf-gsettings-backend \
gsettings-desktop-schemas \
&& rm -rf /var/lib/apt/lists/*
Comment on lines +10 to +45
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dockerfile.dev installs GTK/VTE libs but is missing several runtime GI/Python dependencies that Guake requires (e.g., python3-gi, python3-dbus, python3-cairo, and the GIR packages for Keybinder/Notify/Wnck). Without these, import gi / gi.require_version("Keybinder"|"Notify"|"Wnck") and DBus features will fail inside the container; align the apt package list with scripts/bootstrap-dev-debian.sh and the dependency list printed in guake/main.py.

Copilot uses AI. Check for mistakes.

# Install Python dependencies
RUN pip install --upgrade pip setuptools wheel && \
pip install pipenv

# Create app directory
WORKDIR /guake

# Copy project files
COPY . .

# Setup development environment
RUN make dev && \
make prepare-install && \
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Dockerfile.dev, make dev already includes prepare-install, so running make prepare-install again is redundant and slows down the image build. Consider removing the extra make prepare-install invocation.

Suggested change
make prepare-install && \

Copilot uses AI. Check for mistakes.
make install-schemas

# Create X11 socket directory
RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix

# Set up entrypoint
RUN chmod +x /guake/scripts/run-local.sh

ENV PATH="/root/.local/bin:${PATH}"

# Default command - enter shell
CMD ["/bin/bash"]

# To run Guake, use: guake &
Loading
Loading