From 47f9110cfe266d8c7028befae9d4f921b3442e13 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 10:14:31 +0200 Subject: [PATCH 01/14] Update docker image docs --- .../config/eggs/creating_a_custom_image.md | 108 ++++++++++-------- 1 file changed, 63 insertions(+), 45 deletions(-) diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index cf9063864..bd9b69648 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -3,7 +3,7 @@ [[toc]] ::: warning -This tutorial uses examples from our [`core:java`](https://github.com/pterodactyl/images/tree/java) docker image, +This tutorial uses examples from our [`yolks:java_17`](https://github.com/pterodactyl/yolks/tree/master/java/17) docker image, which can be found on GitHub. This tutorial also assumes some knowledge of [Docker](https://docker.io/), we suggest reading up if this all looks foreign to you. ::: @@ -13,52 +13,58 @@ reading up if this all looks foreign to you. The most important part of this process is to create the [`Dockerfile`](https://docs.docker.com/engine/reference/builder/) that will be used by the Daemon. Due to heavy restrictions on server containers, you must setup this file in a specific manner. -We try to make use of [Alpine Linux](https://alpinelinux.org) as much as possible for our images in order to keep their size down. +In most images we try to use a [Debian based OS](https://www.debian.org) as much as possible for our images. -```bash -# ---------------------------------- -# Pterodactyl Core Dockerfile -# Environment: Java -# Minimum Panel Version: 0.6.0 -# ---------------------------------- -FROM openjdk:8-jdk-alpine - -MAINTAINER Pterodactyl Software, +```dockerfile +FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:17-jdk-jammy -RUN apk add --no-cache --update curl ca-certificates openssl git tar bash sqlite fontconfig \ - && adduser --disabled-password --home /home/container container +LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" -USER container -ENV USER=container HOME=/home/container +LABEL org.opencontainers.image.source="https://github.com/pterodactyl/yolks" +LABEL org.opencontainers.image.licenses=MIT -WORKDIR /home/container +RUN apt-get update -y \ + && apt-get install -y lsof curl ca-certificates openssl git tar sqlite3 fontconfig libfreetype6 tzdata iproute2 libstdc++6 \ + && useradd -d /home/container -m container -COPY ./entrypoint.sh /entrypoint.sh +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container -CMD ["/bin/bash", "/entrypoint.sh"] +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] ``` Lets walk through the `Dockerfile` above. The first thing you'll notice is the [`FROM`](https://docs.docker.com/engine/reference/builder/#from) declaration. ```bash -FROM openjdk:8-jdk-alpine +FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:17-jdk-jammy ``` -In this case, we are using [`openjdk:8-jdk-alpine`](https://github.com/docker-library/openjdk) which provides us with Java 8. +The `--platform=$TARGETOS/$TARGETARCH` allows us to specify in the github workflow that we want to build for linux/amd64 and linux/arm64. See [Docker docs](https://docs.docker.com/engine/reference/builder/#from) + +In this case, we are using [`eclipse-temurin:17-jdk-jammy`](https://github.com/adoptium/containers/tree/main) which provides us with Java 17. ## Installing Dependencies -The next thing we do is install the dependencies we will need using Alpine's package manager: `apk`. You'll notice some -specific flags that keep the container small, including `--no-cache`, as well as everything being contained in a +The next thing we do is install the dependencies we will need using Debian/Ubuntu's package manager: `apt`. You'll notice some +specific flags `-y` as the docker build is non interactive, as well as everything being contained in a single [`RUN`](https://docs.docker.com/engine/reference/builder/#run) block. +## Files in the Docker image +::: warning +Because the way that Pterodactyl works no files can be placed in the docker container in `/home/container`. +::: + +All files must be downloaded with the egg install script, this means for example that you can not put your bot files or minecraft server jar can not be put in the image as you can with regular docker images + ## Creating a Container User Within this `RUN` block, you'll notice the `useradd` command. ```bash -adduser -D -h /home/container container -``` + useradd -d /home/container -m container + ``` ::: warning All Pterodactyl containers must have a user named `container`, and the user home **must** be `/home/container`. @@ -79,8 +85,8 @@ we define the command to be used when the container is started using [`CMD`](htt The `CMD` line should always point to the `entrypoint.sh` file. ```bash -COPY ./entrypoint.sh /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] +COPY ./../entrypoint.sh /entrypoint.sh +CMD [ "/bin/bash", "/entrypoint.sh" ] ``` ## Entrypoint Script @@ -92,18 +98,31 @@ These entrypoint files are actually fairly abstracted, and the Daemon will pass variable before processing it and then executing the command. ```bash -#!/bin/bash -cd /home/container - -# Output Current Java Version -java -version ## only really needed to show what version is being used. Should be changed for different applications - -# Replace Startup Variables -MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` -echo ":/home/container$ ${MODIFIED_STARTUP}" - -# Run the Server -${MODIFIED_STARTUP} +# Default the TZ environment variable to UTC. +TZ=${TZ:-UTC} +export TZ + +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Switch to the container's working directory +cd /home/container || exit 1 + +# Print Java version +printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mjava -version\n" +java -version + +# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell +# variable format of "${VARIABLE}" before evaluating the string and automatically +# replacing the values. +PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)") + +# Display the command we're running in the output, and then execute it with the env +# from the container itself. +printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" +# shellcheck disable=SC2086 +exec env ${PARSED} ``` The second command, `cd /home/container`, simply ensures we are in the correct directory when running the rest of the @@ -116,16 +135,15 @@ is parsing the environment `STARTUP` that is passed into the container by the Da looks something like the example below: ```bash -STARTUP="java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}" +STARTUP="java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}" ``` ::: v-pre -You'll notice some placeholders there, specifically `{{SERVER_MEMORY}}` and `{{SERVER_JARFILE}}`. These both refer to +You'll notice some placeholders there, specifically `{{SERVER_JARFILE}}`. These refer to other environment variables being passed in, and they look something like the example below. ::: ```bash -SERVER_MEMORY=1024 SERVER_JARFILE=server.jar ``` @@ -133,7 +151,7 @@ There are a host of different environment variables, and they change depending o configuration. However, that is not necessarily anything to worry about here. ```bash -MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` +PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)") ``` ::: v-pre @@ -142,18 +160,18 @@ curly braces `{{EXAMPLE}}` with a matching environment variable (such as `EXAMPL ::: ```bash -java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}} +java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}" ``` Becomes: ```bash -java -Xms128M -Xmx1024M -jar server.jar +java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar server.jar" ``` ## Run the Command -The last step is to run this modified startup command, which is done with the line `${MODIFIED_STARTUP}`. +The last step is to run this modified startup command, which is done with the line `exec env ${PARSED}`. ### Note From d0f3ab86de8ff4feb3a07a7026d23f1f4548b369 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 10:29:19 +0200 Subject: [PATCH 02/14] Update egg docs --- .../config/eggs/creating_a_custom_egg.md | 59 ++++++++++++++++++- .../config/eggs/creating_a_custom_image.md | 2 +- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/community/config/eggs/creating_a_custom_egg.md b/community/config/eggs/creating_a_custom_egg.md index 7d4bd513c..cd98339a0 100644 --- a/community/config/eggs/creating_a_custom_egg.md +++ b/community/config/eggs/creating_a_custom_egg.md @@ -30,6 +30,29 @@ can be tweaked per-server if needed). _Docker images must be specifically designed to work with Pterodactyl Panel._ You should read more about that in our [Creating a Docker Image](/community/config/eggs/creating_a_custom_image.md) guide. +## The Pterodactyl Install Procces + +:: warning +Please be aware of how the pterodactyl install proces works! +::: + +``` +1. Spin up install container + Creates a new container using an install image that's run as root. + Uses a volume mount on `/mnt/server` for the server files, which is the working directory during installation. + The volume will be later mounted as `/home/container` for the server container. Any files outside of `/mnt/server` will be gone after installation. + Install script can pull files or set up all that is needed to run the server, such as writing files, directories or compiling apps. + It is regularly used to just download the files required. Such as server files and configs. + +2. Stop and destroy install container + +3. Start a new container with the server files in /home/container + This is where the server is actually run. No root privileges. + Any dependencies installed during the install process are gone. + The container that is started should have everything you need. + No packages can be installed. Any required dependencies must exist in the used Docker image. +``` + ## Configure Process Management This is perhaps the most important step in this service option configuration, as this tells the Daemon how to run everything. @@ -80,6 +103,10 @@ Avoid using this parser if possible. * `json` (supports `*` notation) * `xml` +::: tip +If you want to use egg non stock variables in the configuration parser you mist reference them as `{{server.build.env.ENVNAME}}` or just `{{env.ENVNAME}}`. Do not forget to to replace `ENVNAME` with the actual enviroment name you have setup. +::: + Once you have defined a parser, we then define a `find` block which tells the Daemon what specific elements to find and replace. In this example, we have provided four separate items within the `server.properties` file that we want to find and replace to the assigned values. You can use either an exact value, or define a specific server setting from @@ -116,6 +143,26 @@ single matching line. In this case, we are looking for either `127.0.0.1` or `lo docker interface defined in the configuration file using `{{config.docker.interface}}`. ::: +#### File Parser +The file parser the whole line that you are trying to edit. For example: + +```json +{ + "main/server.cfg": { + "parser": "file", + "find": { + "seta sv_hostname": "seta sv_hostname \"{{env.SERVER_NAME}}\"", + "seta sv_maxClients": "seta sv_maxClients \"{{env.SERVER_MAXCLIENTS}}\"", + "seta rconPassword": "seta rconPassword \"{{env.RCON_PASSWORD}}\"", + "seta g_password": "seta g_password \"{{env.SERVER_PASSWORD}}\"", + "Map": "Map {{env.SERVER_MAP}}" + } + } +} +``` + +The `"` on the right side are escaped with a `\` because else they would brake the json syntax for the parser. + ### Start Configuration The last block to configure is the `Start Configuration` for servers running using this service option. @@ -127,7 +174,17 @@ The last block to configure is the `Start Configuration` for servers running usi In the example block above, we define `done` as the entire line, or part of a line that indicates a server is done starting, and is ready for players to join. When the Daemon sees this output, it will mark the server as `ON` rather -than `STARTING`. +than `STARTING`. + +If your aplication has multiple messages that mean that it is fully startup then you can also do it like this: +```json +{ + "done":[ + "change this text 1", + "change this text 2" + ] +} +``` That concludes basic service option configuration. diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index bd9b69648..e1b0d14bc 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -51,7 +51,7 @@ The next thing we do is install the dependencies we will need using Debian/Ubunt specific flags `-y` as the docker build is non interactive, as well as everything being contained in a single [`RUN`](https://docs.docker.com/engine/reference/builder/#run) block. -## Files in the Docker image +## Files In The Docker Image ::: warning Because the way that Pterodactyl works no files can be placed in the docker container in `/home/container`. ::: From 174a1952fa665c2d69cab96fb3d2248334bd62cf Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 10:40:25 +0200 Subject: [PATCH 03/14] typo 1 --- community/config/eggs/creating_a_custom_egg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/config/eggs/creating_a_custom_egg.md b/community/config/eggs/creating_a_custom_egg.md index cd98339a0..37f8cb19d 100644 --- a/community/config/eggs/creating_a_custom_egg.md +++ b/community/config/eggs/creating_a_custom_egg.md @@ -104,7 +104,7 @@ Avoid using this parser if possible. * `xml` ::: tip -If you want to use egg non stock variables in the configuration parser you mist reference them as `{{server.build.env.ENVNAME}}` or just `{{env.ENVNAME}}`. Do not forget to to replace `ENVNAME` with the actual enviroment name you have setup. +If you want to use egg non stock variables in the configuration parser you must reference them as `{{server.build.env.ENVNAME}}` or just `{{env.ENVNAME}}`. Do not forget to to replace `ENVNAME` with the actual enviroment name you have setup. ::: Once you have defined a parser, we then define a `find` block which tells the Daemon what specific elements to find From 1aab30ffa92b0b10270b9d0e3202cf705dc1ffca Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 10:53:14 +0200 Subject: [PATCH 04/14] some more improvements --- .../config/eggs/creating_a_custom_egg.md | 2 +- .../config/eggs/creating_a_custom_image.md | 22 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/community/config/eggs/creating_a_custom_egg.md b/community/config/eggs/creating_a_custom_egg.md index 37f8cb19d..5bf5619d4 100644 --- a/community/config/eggs/creating_a_custom_egg.md +++ b/community/config/eggs/creating_a_custom_egg.md @@ -32,7 +32,7 @@ our [Creating a Docker Image](/community/config/eggs/creating_a_custom_image.md) ## The Pterodactyl Install Procces -:: warning +::: warning Please be aware of how the pterodactyl install proces works! ::: diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index e1b0d14bc..3cd722f83 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -15,7 +15,7 @@ that will be used by the Daemon. Due to heavy restrictions on server containers, In most images we try to use a [Debian based OS](https://www.debian.org) as much as possible for our images. -```dockerfile +```bash FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:17-jdk-jammy LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" @@ -49,7 +49,11 @@ In this case, we are using [`eclipse-temurin:17-jdk-jammy`](https://github.com/a The next thing we do is install the dependencies we will need using Debian/Ubuntu's package manager: `apt`. You'll notice some specific flags `-y` as the docker build is non interactive, as well as everything being contained in a -single [`RUN`](https://docs.docker.com/engine/reference/builder/#run) block. +single [`RUN`](https://docs.docker.com/engine/reference/builder/#run) block. + +::: warning +The dependencie `iproute2` is required in every docker container to make the ip command work +::: ## Files In The Docker Image ::: warning @@ -125,7 +129,19 @@ printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" exec env ${PARSED} ``` -The second command, `cd /home/container`, simply ensures we are in the correct directory when running the rest of the +First we set the timezone. +```bash +TZ=${TZ:-UTC} +export TZ +``` + +Then we make the internal ip avaible in the docker container. +```bash +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP +``` + +The third command, `cd /home/container`, simply ensures we are in the correct directory when running the rest of the commands. We then follow that up with `java -version` to output this information to end-users, but that is not necessary. ## Modifying the Startup Command From 73efa8ab6dea88819b3d3591803b712a93d61d8b Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 10:55:00 +0200 Subject: [PATCH 05/14] remove not needed " --- community/config/eggs/creating_a_custom_image.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index 3cd722f83..20746fc9d 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -176,13 +176,13 @@ curly braces `{{EXAMPLE}}` with a matching environment variable (such as `EXAMPL ::: ```bash -java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}" +java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}} ``` Becomes: ```bash -java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar server.jar" +java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar server.jar ``` ## Run the Command From a0b9692222ca3f7397c4e03953191ada759a614e Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 11:00:29 +0200 Subject: [PATCH 06/14] shorten java startup example --- community/config/eggs/creating_a_custom_image.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index 20746fc9d..5101769c9 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -151,7 +151,7 @@ is parsing the environment `STARTUP` that is passed into the container by the Da looks something like the example below: ```bash -STARTUP="java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}}" +STARTUP="java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}}" ``` ::: v-pre @@ -176,13 +176,13 @@ curly braces `{{EXAMPLE}}` with a matching environment variable (such as `EXAMPL ::: ```bash -java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}} +java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}} ``` Becomes: ```bash -java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar server.jar +java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}} server.jar ``` ## Run the Command From ea470bfa0355e907dbe4f162d51983b3c72732df Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 11:26:24 +0200 Subject: [PATCH 07/14] remove {{SERVER_JARFILE}} from where there only should be server.jar --- community/config/eggs/creating_a_custom_image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index 5101769c9..ed131bb66 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -182,7 +182,7 @@ java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}} Becomes: ```bash -java -Xms128M -XX:MaxRAMPercentage=95.0 -jar {{SERVER_JARFILE}} server.jar +java -Xms128M -XX:MaxRAMPercentage=95.0 -jar server.jar ``` ## Run the Command From 276c413c3805778bbdc30d867e31c46b897e6456 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:10:53 +0200 Subject: [PATCH 08/14] Improve grammar --- community/config/eggs/creating_a_custom_egg.md | 10 +++++----- community/config/eggs/creating_a_custom_image.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/community/config/eggs/creating_a_custom_egg.md b/community/config/eggs/creating_a_custom_egg.md index 5bf5619d4..018cb8de2 100644 --- a/community/config/eggs/creating_a_custom_egg.md +++ b/community/config/eggs/creating_a_custom_egg.md @@ -38,16 +38,16 @@ Please be aware of how the pterodactyl install proces works! ``` 1. Spin up install container - Creates a new container using an install image that's run as root. + Creates a new container using an install image which runs as root. Uses a volume mount on `/mnt/server` for the server files, which is the working directory during installation. The volume will be later mounted as `/home/container` for the server container. Any files outside of `/mnt/server` will be gone after installation. - Install script can pull files or set up all that is needed to run the server, such as writing files, directories or compiling apps. - It is regularly used to just download the files required. Such as server files and configs. + The installation script can set up everything that's required to run the server, such as writing files, creating directories, or compiling apps." + It is regularly used to just download the files required, such as server files and configs. 2. Stop and destroy install container 3. Start a new container with the server files in /home/container - This is where the server is actually run. No root privileges. + This is where the server is is actually ran, without root privileges. Any dependencies installed during the install process are gone. The container that is started should have everything you need. No packages can be installed. Any required dependencies must exist in the used Docker image. @@ -161,7 +161,7 @@ The file parser the whole line that you are trying to edit. For example: } ``` -The `"` on the right side are escaped with a `\` because else they would brake the json syntax for the parser. +The `"` on the right side are escaped with a `\` because else they would break the json syntax for the parser. ### Start Configuration The last block to configure is the `Start Configuration` for servers running using this service option. diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index ed131bb66..b85f55c4f 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -13,7 +13,7 @@ reading up if this all looks foreign to you. The most important part of this process is to create the [`Dockerfile`](https://docs.docker.com/engine/reference/builder/) that will be used by the Daemon. Due to heavy restrictions on server containers, you must setup this file in a specific manner. -In most images we try to use a [Debian based OS](https://www.debian.org) as much as possible for our images. +We try to use a [Debian based OS](https://www.debian.org) as much as possible for our images ```bash FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:17-jdk-jammy @@ -52,12 +52,12 @@ specific flags `-y` as the docker build is non interactive, as well as everythin single [`RUN`](https://docs.docker.com/engine/reference/builder/#run) block. ::: warning -The dependencie `iproute2` is required in every docker container to make the ip command work +The dependency `iproute2` is required in every docker container to make the ip command work ::: ## Files In The Docker Image ::: warning -Because the way that Pterodactyl works no files can be placed in the docker container in `/home/container`. +Because the way that Pterodactyl works, no files can be placed in the docker container in `/home/container`. ::: All files must be downloaded with the egg install script, this means for example that you can not put your bot files or minecraft server jar can not be put in the image as you can with regular docker images From 94152ceae52ae0dcc64dbe2cdd7b58bc8f5b25fc Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:13:45 +0200 Subject: [PATCH 09/14] remove extra " --- community/config/eggs/creating_a_custom_egg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/config/eggs/creating_a_custom_egg.md b/community/config/eggs/creating_a_custom_egg.md index 018cb8de2..80a948e8e 100644 --- a/community/config/eggs/creating_a_custom_egg.md +++ b/community/config/eggs/creating_a_custom_egg.md @@ -41,7 +41,7 @@ Please be aware of how the pterodactyl install proces works! Creates a new container using an install image which runs as root. Uses a volume mount on `/mnt/server` for the server files, which is the working directory during installation. The volume will be later mounted as `/home/container` for the server container. Any files outside of `/mnt/server` will be gone after installation. - The installation script can set up everything that's required to run the server, such as writing files, creating directories, or compiling apps." + The installation script can set up everything that's required to run the server, such as writing files, creating directories, or compiling apps. It is regularly used to just download the files required, such as server files and configs. 2. Stop and destroy install container From 9e275835a6229340846be327aa46b410b9e49ebe Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:08:55 +0200 Subject: [PATCH 10/14] fix more grammar --- community/config/eggs/creating_a_custom_egg.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/community/config/eggs/creating_a_custom_egg.md b/community/config/eggs/creating_a_custom_egg.md index 80a948e8e..323f65888 100644 --- a/community/config/eggs/creating_a_custom_egg.md +++ b/community/config/eggs/creating_a_custom_egg.md @@ -33,7 +33,7 @@ our [Creating a Docker Image](/community/config/eggs/creating_a_custom_image.md) ## The Pterodactyl Install Procces ::: warning -Please be aware of how the pterodactyl install proces works! +Please be aware of how the pterodactyl install process works! ::: ``` @@ -104,7 +104,7 @@ Avoid using this parser if possible. * `xml` ::: tip -If you want to use egg non stock variables in the configuration parser you must reference them as `{{server.build.env.ENVNAME}}` or just `{{env.ENVNAME}}`. Do not forget to to replace `ENVNAME` with the actual enviroment name you have setup. +If you want to use egg non stock variables in the configuration parser you must reference them as `{{server.build.env.ENVNAME}}` or just `{{env.ENVNAME}}`. Do not forget to to replace `ENVNAME` with the actual environment name you have setup. ::: Once you have defined a parser, we then define a `find` block which tells the Daemon what specific elements to find @@ -144,7 +144,7 @@ docker interface defined in the configuration file using `{{config.docker.interf ::: #### File Parser -The file parser the whole line that you are trying to edit. For example: +The file parser replaces the whole line that you are trying to edit. So you have to use it like this: ```json { @@ -176,7 +176,7 @@ In the example block above, we define `done` as the entire line, or part of a li starting, and is ready for players to join. When the Daemon sees this output, it will mark the server as `ON` rather than `STARTING`. -If your aplication has multiple messages that mean that it is fully startup then you can also do it like this: +If your application has multiple messages that mean that it is fully startup then you can also do it like this: ```json { "done":[ From 055641a73f905fb43e937776261e30cd8a6b184b Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:33:56 +0200 Subject: [PATCH 11/14] remove extra space before ``` --- community/config/eggs/creating_a_custom_image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index b85f55c4f..6971006ab 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -68,7 +68,7 @@ Within this `RUN` block, you'll notice the `useradd` command. ```bash useradd -d /home/container -m container - ``` +``` ::: warning All Pterodactyl containers must have a user named `container`, and the user home **must** be `/home/container`. From 383877378319cca7e29ab25114f69fa977f381df Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Mon, 23 Oct 2023 09:58:59 +0200 Subject: [PATCH 12/14] cleanup Files in The docker Image --- community/config/eggs/creating_a_custom_image.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index 6971006ab..814f72f2a 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -57,10 +57,10 @@ The dependency `iproute2` is required in every docker container to make the ip c ## Files In The Docker Image ::: warning -Because the way that Pterodactyl works, no files can be placed in the docker container in `/home/container`. +Because the way that Pterodactyl works, it is not possible to store any files within the Docker image at `/home/container`. ::: -All files must be downloaded with the egg install script, this means for example that you can not put your bot files or minecraft server jar can not be put in the image as you can with regular docker images +All files must be downloaded with the egg install script, this means for example that you can not put your bot files or minecraft server jars in the Docker image as you can with regular docker images ## Creating a Container User From 06a3c521ea3839fe124b3f49a32d5bfb4c276249 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Mon, 23 Oct 2023 09:59:46 +0200 Subject: [PATCH 13/14] forgoten . --- community/config/eggs/creating_a_custom_image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community/config/eggs/creating_a_custom_image.md b/community/config/eggs/creating_a_custom_image.md index 814f72f2a..b12077300 100644 --- a/community/config/eggs/creating_a_custom_image.md +++ b/community/config/eggs/creating_a_custom_image.md @@ -60,7 +60,7 @@ The dependency `iproute2` is required in every docker container to make the ip c Because the way that Pterodactyl works, it is not possible to store any files within the Docker image at `/home/container`. ::: -All files must be downloaded with the egg install script, this means for example that you can not put your bot files or minecraft server jars in the Docker image as you can with regular docker images +All files must be downloaded with the egg install script, this means for example that you can not put your bot files or minecraft server jars in the Docker image as you can with regular docker images. ## Creating a Container User From 4be5e2729a9832f9d52ee35d114a061fe645614f Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:49:36 +0100 Subject: [PATCH 14/14] Make it work! --- community/config/eggs/creating_a_custom_egg.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/community/config/eggs/creating_a_custom_egg.md b/community/config/eggs/creating_a_custom_egg.md index 323f65888..acce366f5 100644 --- a/community/config/eggs/creating_a_custom_egg.md +++ b/community/config/eggs/creating_a_custom_egg.md @@ -72,7 +72,7 @@ This can be set like below. ```json {} -``` +``` ### Configuration Files The next block is one of the most complex blocks, the `Configuration Files` descriptor. The Daemon will process this @@ -104,7 +104,15 @@ Avoid using this parser if possible. * `xml` ::: tip -If you want to use egg non stock variables in the configuration parser you must reference them as `{{server.build.env.ENVNAME}}` or just `{{env.ENVNAME}}`. Do not forget to to replace `ENVNAME` with the actual environment name you have setup. +If you want to use egg non stock variables in the configuration parser you must reference them as +```text +{{server.build.env.ENVNAME}} +``` +or just +```text +{{env.ENVNAME}} +``` +Do not forget to to replace `ENVNAME` with the actual environment name you have setup. ::: Once you have defined a parser, we then define a `find` block which tells the Daemon what specific elements to find