Experience
Projects
My Stack
Case studies
Contact me
Open my CV

·13 min read

Custom Pterodactyl Yolks: Docker Images for Wings Containers

When I built the hosting platform behind RE:NODE on top of Pterodactyl, the stock images covered most game servers and a few runtimes, but not what I wanted to sell: a PHP host, a database, a cache, a mail server, an S3 endpoint. So I started writing my own images. They are all public on GitHub, and this post is about the patterns that repeat across them and the failures that taught me each one.

Role
Creator
Period
Oct 2026
Status
Public images; the pterodactyl-* repos boot-test in CI before publishing, the yolks repo rebuilds monthly
Stack
Docker, Bash, Pterodactyl and Wings, GitHub Actions

The challenge

An image that builds is not an image that works. Wings starts containers as an unprivileged user, drops Linux capabilities, hands the process one allocated port and a single persistent volume, and puts a startup string from the panel in an environment variable. Official images assume none of that. Most of them fail in confusing ways, with errors that point at the service rather than at the platform.

Hosting is also unforgiving about defaults. A database on a public port without a password, or a container that stays "starting" forever after a crash, is a customer-facing incident, not a cosmetic bug.

My responsibility

  • Writing every image: the Dockerfiles, entrypoints, eggs and READMEs, for PHP, MySQL, Valkey, Stalwart, n8n, SeaweedFS and SQL Server, plus the runtime images in the yolks repo.
  • Making each one run as uid 988 with everything under /home/container.
  • The safe defaults: refusing to start without a password, config written outside the customer's volume, memory sized from the cgroup.
  • The CI that boots each image the way Wings does, and the GitHub Actions workflows that build and publish them.
  • Debugging each failure under Wings conditions and fixing it in the image rather than asking customers to work around it.

How I approached it

What a yolk is

Pterodactyl runs every server as a Docker container managed by its daemon, Wings. An egg describes the server in the panel (variables, startup command, install script). A yolk is the Docker image an egg points to. The panel passes the startup command to the container in a STARTUP environment variable, using {{VARIABLE}} placeholders, and the image's entrypoint expands and runs it.

The convention, from the parkervcp yolks collection, is: user container, home and working directory /home/container (the server's persistent volume), and an entrypoint that turns {{VAR}} into ${VAR}. My yolks repo keeps that same expansion on purpose, so eggs written for the parkervcp images behave the same on mine. It carries Zig runtimes (tags zig_0.14 to zig_0.17, amd64 and arm64), Rust, Ruby, Crystal, BEAM, Nim and Dart, and app images such as Vaultwarden, Forgejo, NocoDB, Directus, Jellyfin, Uptime Kuma and n8n. The other repos are single-purpose images: pterodactyl-php, pterodactyl-mysql, pterodactyl-valkey, pterodactyl-stalwart, pterodactyl-n8n, pterodactyl-seaweedfs and pterodactyl-mssql.

STARTUP variablestarts as uid 988runssed, then setsiddataPanelegg: variables, startupWingsdaemon on the nodeYolk imageuser containerentrypointexpands STARTUPService processown session via setsid/home/containeronly persistent volume
Figure 1. How a server starts on one of these yolks: Wings runs the image as uid 988, and the entrypoint expands the panel's STARTUP string into its own session.

The constraint: nothing privileged

Wings does not run your container as root. Every Dockerfile I wrote starts the same way:

pterodactyl-mysql/Dockerfile
# Wings runs containers as its system user (default uid 988). Match it so
# mysqld has a passwd entry. Override with --build-arg if yours differs.
ARG CONTAINER_UID=988

USER root
RUN useradd -m -u ${CONTAINER_UID} -d /home/container -s /bin/bash container
...
ENV USER=container HOME=/home/container
USER container
WORKDIR /home/container

Without a passwd entry for that uid, many daemons refuse to start or cannot find a home directory. Everything the server owns has to live under /home/container, because that is the only volume that persists.

Wingsthe daemon, drops cap_net_bind_service
Docker containerruns as uid 988, no root
Yolk imageuser container, HOME /home/container
entrypointexpands STARTUP, reads SERVER_PORT
Servicemysqld, valkey, stalwart and others
Figure 2. The stack a yolk lives in, from the node down to the service.

Why the container must not keep file capabilities

This one cost me the most time, and it is the clearest case of an image that builds fine and cannot start. In pterodactyl-mssql 9a46108 (Oct 2026) I wrote the reason into the Dockerfile: sqlservr ships with the file capability cap_net_bind_service. Wings drops that capability from every container, and the kernel refuses to exec a binary whose file capabilities exceed the container's bounding set. The symptom is "Operation not permitted" on a binary that is plainly there and executable.

Stalwart's Dockerfile removes the capability directly:

pterodactyl-stalwart/Dockerfile
RUN setcap -r /usr/local/bin/stalwart

Where there are many binaries, as in SQL Server's tree, the images rewrite each file, which drops the security.capability xattr:

pterodactyl-valkey/Dockerfile
RUN find /usr/local/bin -type f -perm -u+x 2>/dev/null | while read -r f; do \
      cp "$f" "$f.nocap" && chmod --reference="$f" "$f.nocap" && mv -f "$f.nocap" "$f"; \
    done

Nothing needs the capability anyway: the ports Wings hands out are high. The result is a container that keeps the least privilege Wings gives it and still starts.

Booting the image the way Wings does, in CI

The same 9a46108 commit is the one that changed how I test. A passing docker build had told me nothing about the capability problem. So the workflow now builds the image for testing and boots it with Wings' uid, the capabilities Wings drops, no-new-privileges, a tty, a memory limit and a startup line prefixed the way the panel prefixes it. The workflow comment states the rule: nothing is pushed unless SQL Server reaches "ready" and answers a query.

pterodactyl-mssql/.github/workflows/docker.yml
docker run -d -t -i --name ci --user 988:988 \
  --cap-drop setpcap --cap-drop mknod --cap-drop net_bind_service \
  --security-opt no-new-privileges --memory 2304m \
  -v /tmp/vol:/home/container \
  -e STARTUP="$STARTUP" mssql-test:ci

The command above is shortened from the real list of dropped capabilities. All seven pterodactyl-* repos have a docker.yml with a boot step of this kind, and the PHP README says every image is booted in CI before it is published.

The banner that got executed

The same commit fixed a second thing found by that test. The entrypoints used to expand the startup string with eval echo. The panel may prefix the command with a console banner of its own, and eval echo runs those commands inside a command substitution and hands their output back as the command to execute. The entrypoint comment spells it out. The fix, repeated in the MySQL, n8n and other images, expands the placeholders with sed and runs the result as a script:

bash
MODIFIED_STARTUP=$(printf '%s' "${STARTUP:-n8n start}" | sed -e 's/{{/${/g' -e 's/}}/}/g')

The CI startup line includes a banner on purpose, and the test greps the log for the banner text, so a regression would fail the build.

A server that fails must take the container down

pterodactyl-mssql 7386ccb (Oct 2026): the entrypoint read panel console lines in a foreground loop, which kept the container alive even if SQL Server had died. Wings would then show "starting" for ever. I moved the console loop into the background, passed stdin explicitly (a background job otherwise gets /dev/null), and ended the script with wait and exit $? so the container lives exactly as long as SQL Server does.

I added a CI step called "Failure exits": it starts the image with ACCEPT_EULA=N, which makes SQL Server refuse to start, and asserts that the container stops. The pattern is the same across the images: a failing service must exit, and a test must prove it.

The init file, the passwords, and who can read them

pterodactyl-mysql b96c9f5 and 46468c5 (both Oct 2026) are about secrets in a startup script. MySQL's first start needs SQL statements run before it takes connections, and those statements carry the root and app passwords. At first the init file path was added to the startup line as --init-file=..., which also printed it to the console. I moved it into the generated config as init-file=${INIT} so the startup line stays clean.

The file is written under umask 077 in /tmp, outside the customer's volume, and removed once MySQL has read it. In 46468c5 I also moved the socket and pid file into a private run directory created with mode 700, and made the CI wait for the init file to disappear before asserting it is gone:

bash
for i in $(seq 1 15); do docker exec ci test -e /tmp/renode-init.sql || break; sleep 1; done
docker exec ci test ! -e /tmp/renode-init.sql

The first version of that assertion raced with the removal. The comment in the workflow says why it matters: the init file carries passwords and must not linger.

Following a redirect in the mail server setup

Stalwart needs five listeners on this server's allocated ports, so the entrypoint starts it once in recovery mode and configures listeners over JMAP. pterodactyl-stalwart 09570f1 (Oct 2026), the commit after a debug commit that printed the session on failure (7b54f3f), found that the /.well-known/jmap request answers with a redirect. Without following it the setup did not get a usable session. The fix is one flag, -L, in the entrypoint and in the CI checks:

bash
session=$(curl -fsSL -u "admin:${MAIL_ADMIN_PASSWORD}" "http://127.0.0.1:${WEB_PORT}/.well-known/jmap" 2>/dev/null) && break

The workflow also asserts that a wrong password gets a 401 and that a restart does not run the listener setup again.

The port comes from the panel

Every entrypoint reads SERVER_PORT and falls back to the service's default (6379 for Valkey, 5678 for n8n, 1433 for SQL Server). Stalwart's defaults (25, 465, 993, 443) cannot be bound here, so it writes a marker file with the ports it configured and redoes the work only when they change.

Safe defaults and refusing to start

The database and cache images refuse to run unprotected:

pterodactyl-valkey/entrypoint.sh
if [ -z "${VALKEY_PASSWORD:-}" ]; then
    echo "Renode: VALKEY_PASSWORD is empty. Refusing to start an open Valkey on a public port."
    exit 1
fi

The same check exists for MYSQL_ROOT_PASSWORD, MAIL_ADMIN_PASSWORD, and the S3 keys in SeaweedFS. The Valkey config is written to /tmp with umask 077, outside the volume, so the customer's file manager never shows a password in plain text. SQL names such as MYSQL_DATABASE are validated against a strict regex rather than quoted.

Sizing to the cgroup, not the host

MySQL and Valkey read the container's memory limit from /sys/fs/cgroup/memory.max (or the cgroup v1 path) and derive their settings from it. Valkey sets maxmemory to about 80% of the limit. The MySQL entrypoint sizes the InnoDB buffer pool at 45% and turns performance_schema off on small servers, with this comment: a 1 GB server given MySQL's defaults is an out-of-memory kill waiting.

0

default uid Wings uses

0%

of the limit as Valkey maxmemory

0%

of the limit as InnoDB buffer pool

Figure 3. Fixed values from the images.

The console is part of the product

Pterodactyl's console sends whatever you type to the container's stdin. Each entrypoint decides what that means for its service:

ImageA console line runs as
pterodactyl-mysqlSQL, as root over the local socket
pterodactyl-valkeya valkey-cli command
pterodactyl-mssqlT-SQL through sqlcmd
pterodactyl-seaweedfsa weed shell command
pterodactyl-phpa shell command in the app directory

Shutdown, and the image with no bash

The entrypoints start the service in its own session with setsid and trap INT and TERM to signal the whole process group. pterodactyl-n8n 394b22f (Oct 2026) is the exception that taught me to read the base image first: the n8n image has no bash and no package manager, so my first entrypoint, which used bash and setsid, could not run. I rewrote it as POSIX sh, set the Dockerfile entrypoint to /bin/sh, and replaced the process group signal with kill -TERM -1, which is safe only because the script is PID 1.

The Zig yolk

The Zig image is a small Debian base because Zig ships its own C compiler and libc. Its zig-start script builds the project in /home/container and runs it. If build.zig.zon mentions ziex, it runs zig build, then zig build zx -- bundle, and copies the bundle into .renode-app/ with cp -a instead of replacing it, because Ziex keeps KV data there and a rebuild must not delete it. The package cache is pointed at /home/container/.cache/zig so dependencies are fetched once per server. SERVER_PORT is exported as PORT.

  1. 01

    zig build

    builds the project in /home/container

  2. 02

    zig build zx -- bundle

    produces the Ziex bundle

  3. 03

    cp -a into .renode-app/

    copies instead of replacing, KV data stays

  4. 04

    Run

    SERVER_PORT is exported as PORT

Figure 4. What zig-start does for a Ziex project.
Note. An image that builds but cannot start under Wings is useless. That is why the boot test, not the build, is the gate for publishing.

Project journey

  1. Oct 2026

    Database and cache images

    MySQL 8.4, Valkey, with eggs (f80c221, 3f6c028)

  2. Oct 2026

    Wings-conditions boot test

    caps dropped, banner prefix, exit on failure for SQL Server (9a46108, 7386ccb)

  3. Oct 2026

    Secrets and startup fixes

    MySQL init file via config, private run dir, n8n POSIX sh (b96c9f5, 46468c5, 394b22f)

  4. Oct 2026

    Mail server setup fixed

    Stalwart JMAP redirect followed (09570f1)

  5. Oct 2026

    Zig 0.14 to 0.17

    multi-arch runtime images in the yolks repo (d0f53cd)

  6. Oct 2026

    More runtimes and apps

    Rust, Ruby, Crystal, BEAM, Nim, Dart, Vaultwarden, Forgejo and others (e028013, 3dcef72, 9708c1f)

Figure 5. The pterodactyl-* images were written and hardened in one day, then the yolks repo grew runtimes and apps.

Beyond the launch

Almost all of the pterodactyl-* history is a single day, 8 October 2026, and most commits after each image's first are fixes found by its own boot test: the SQL Server capabilities and exit behavior, MySQL's init file and run directory, the n8n shell, the Stalwart redirect. The yolks repo came after, on 18 and 19 October, with a build workflow per image family; the Zig workflow has a monthly schedule, and the README says images rebuild on push and monthly for base-image security updates.

What is still open: there are no tags or releases in these repos, so a customer follows the image tags and not a changelog. The yolks workflows do not boot-test the way the pterodactyl-* ones do. I would add that next.

The outcome

Eight public repos exist: seven single-service images (PHP, MySQL, Valkey, Stalwart, n8n, SeaweedFS, SQL Server) with eggs and a CI boot test each, and a yolks repo with runtime and app images including Zig 0.14 to 0.17 for amd64 and arm64. Each image runs as uid 988, keeps data under /home/container, and refuses to start without the credentials it needs.

Evidence

#pterodactyl#docker#wings#devops

Keep reading

Have a project in mind?