Sign inSign up

hudsonventura/headless

By hudsonventura

•Updated 8 months ago

Run GNU/Linux distribution with GUI inside a Docker container to run your GUI app with few resources

Image
0

515

hudsonventura/headless repository overview

⁠headless

Run a GNU/Linux distribution with a GUI inside a Docker container to run your graphical applications with as few resources as possible.

Access the desktop through VNC (port 5901) or directly in your browser via noVNC (port 6901).

⁠Stack


⁠Available Images

⁠Debian Based
ImageBaseImage SizeRAM Consumption
hudsonventura/headless:ubuntu_24.04Ubuntu 24.04 LTS879MB~ 52MB
⁠RHEL Based
ImageBaseImage SizeRAM Consumption
hudsonventura/headless:almalinux_9AlmaLinux 9957MB~ 44MB
hudsonventura/headless:rockylinux_9Rocky Linux 91.11GB~ 45MB

⁠Quick Start

Create a docker-compose.yml file:

services:
  headless:
    # Choose your base
    image: hudsonventura/headless:ubuntu_24.04
    #image: hudsonventura/headless:almalinux_9
    #image: hudsonventura/headless:rockylinux_9
    
    ports:
      - "5901:5901"
      - "6901:6901"
    environment:
      - VNC_PW=password
      - SCREEN_RESOLUTION=1280x720
    restart: unless-stopped

Then start it:

docker compose up -d

Now access the desktop:

To stop:

docker compose down

⁠Use to build your image

Those image is to you generate your own images.
ForHow example, create a file Dockerfile and put this content to create a container with Firefox:

FROM hudsonventura/headless:ubuntu_24.04

# Add your applications here
RUN apt-get update && apt-get install -y \
    firefox \
    && rm -rf /var/lib/apt/lists/*

⁠Examples

At the dir examples you can find some examples of how to use this image.
For example, create a file docker-compose.yml and put this content to create a container with Google Chrome. It will start Google Chrome automatically inside the container. If Chrome stopes, the container stops as well.

services:

  chromium-test:
    build:
      context: ./
      dockerfile: Dockerfile
    ports:
      - "5901:5901"
      - "6901:6901"
    environment:
      - VNC_PW=password
      - SCREEN_RESOLUTION=1280x720
    restart: unless-stopped

    # The command below wait the X server to be ready and then start the chrome. If chrome closes, the container will restart.
    command: >
      sh -c "/start.sh &
            until xdpyinfo -display :1 >/dev/null 2>&1; do
              echo 'Waiting for X...';
              sleep 1;
            done;
            DISPLAY=:1 google-chrome --no-sandbox"

Create a file Dockerfile and put this content:

FROM hudsonventura/headless:ubuntu_24.04


RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
    sudo apt update

RUN sudo apt install -y fonts-liberation libasound2t64 libnspr4 libnss3 xdg-utils && \
    sudo apt install -y ./google-chrome-stable_current_amd64.deb*

# Wrap Google Chrome to run with --no-sandbox to avoid needing privileged container modes
RUN sudo mv /usr/bin/google-chrome-stable /usr/bin/google-chrome-stable.real && \
    printf '#!/bin/bash\nexec /usr/bin/google-chrome-stable.real --no-sandbox --disable-dev-shm-usage "$@"\n' | sudo tee /usr/bin/google-chrome-stable && \
    sudo chmod +x /usr/bin/google-chrome-stable

⁠Environment Variables

VariableDefaultDescription
VNC_PWpasswordPassword for VNC connection
SCREEN_RESOLUTION1280x720Screen resolution (e.g. 1920x1080, 1280x720)

⁠Ports

PortService
5901VNC server (connect with any VNC client)
6901noVNC web client (access via browser)

⁠License

Repository: https://github.com/hudsonventura/headless⁠
This project is licensed under the terms of the GPL-3.0 license⁠.

Tag summary

Content type

Image

Digest

sha256:7d3962a14…

Size

281.2 MB

Last updated

8 months ago

docker pull hudsonventura/headless:ubuntu_24.04