From 58c8f3139e341228447e34e335e498251adeb9f6 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Tue, 29 Jun 2021 11:19:16 -0600 Subject: [PATCH 1/5] Add 64 bit sdl2 library --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 0de4a17..e580da4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -107,6 +107,7 @@ RUN dpkg --add-architecture i386 && \ libcurl3-gnutls:i386 \ libcurl4 \ libncurses5:i386 \ + libsdl2-2.0-0 \ libsdl2-2.0-0:i386 \ libtinfo5:i386 \ # -------------------- From f547e866a2f9cc0b67a3438add2c78281f0064e1 Mon Sep 17 00:00:00 2001 From: MitchTalmadge Date: Sat, 3 Jul 2021 09:19:52 -0600 Subject: [PATCH 2/5] Add support for user startup scripts --- entrypoint/main.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entrypoint/main.sh b/entrypoint/main.sh index 482a80b..d6e42d4 100644 --- a/entrypoint/main.sh +++ b/entrypoint/main.sh @@ -13,6 +13,12 @@ echo "Thank you!!" echo "----------------------" echo "" +# Run user startup scripts +if [ ! -z "$STARTUP_SCRIPT" ]; then + echo "Running startup script..." + /bin/bash /scripts/$STARTUP_SCRIPT +fi + # Copy the pre-cached AMP Core from the image into the location AMP expects. # This will allow upgrades to use the cache and not need to do any downloads. echo "Copying AMP Core..." From 660aa41434008eacae871d78cf5f8d1ac26e495f Mon Sep 17 00:00:00 2001 From: MitchTalmadge Date: Sat, 3 Jul 2021 09:40:53 -0600 Subject: [PATCH 3/5] Check if startup script exists --- entrypoint/main.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/entrypoint/main.sh b/entrypoint/main.sh index d6e42d4..3273d8b 100644 --- a/entrypoint/main.sh +++ b/entrypoint/main.sh @@ -16,7 +16,12 @@ echo "" # Run user startup scripts if [ ! -z "$STARTUP_SCRIPT" ]; then echo "Running startup script..." - /bin/bash /scripts/$STARTUP_SCRIPT + if [ -f "/scripts/$STARTUP_SCRIPT" ]; then + chmod +x /scripts/$STARTUP_SCRIPT + /bin/bash /scripts/$STARTUP_SCRIPT + else + echo "ERROR: Startup script not found!" + fi fi # Copy the pre-cached AMP Core from the image into the location AMP expects. From 060f981ac62bdca39cdb6931fcb78b204161f332 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Sat, 28 Aug 2021 00:54:32 -0600 Subject: [PATCH 4/5] Make startup script run if found --- entrypoint/main.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/entrypoint/main.sh b/entrypoint/main.sh index 3273d8b..5e349a0 100644 --- a/entrypoint/main.sh +++ b/entrypoint/main.sh @@ -13,15 +13,12 @@ echo "Thank you!!" echo "----------------------" echo "" -# Run user startup scripts -if [ ! -z "$STARTUP_SCRIPT" ]; then +# Run user startup script +STARTUP_SCRIPT="/home/amp/scripts/startup.sh" +if [ -f ${STARTUP_SCRIPT} ]; then echo "Running startup script..." - if [ -f "/scripts/$STARTUP_SCRIPT" ]; then - chmod +x /scripts/$STARTUP_SCRIPT - /bin/bash /scripts/$STARTUP_SCRIPT - else - echo "ERROR: Startup script not found!" - fi + chmod +x ${STARTUP_SCRIPT} + /bin/bash ${STARTUP_SCRIPT} fi # Copy the pre-cached AMP Core from the image into the location AMP expects. From 7a6e91bf39b1670dc5dfb6b53670633eda9bd97b Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Tue, 14 Sep 2021 23:03:26 -0600 Subject: [PATCH 5/5] Add instructions for startup script --- README.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6e068d6..d192fc6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ # AMP-dockerized -[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/mitchtalmadge/amp-dockerized)](https://hub.docker.com/r/mitchtalmadge/amp-dockerized) - This repository bundles [CubeCoders AMP](https://cubecoders.com/AMP) into a Debian-based [Docker image.](https://hub.docker.com/r/mitchtalmadge/amp-dockerized) (`mitchtalmadge/amp-dockerized:latest`) so that you can set up game servers with ease! @@ -165,12 +163,27 @@ Example: `TZ=America/Denver` |-------|----------------------------------------------------------------------|---------------| | `NIGHTLY` | Set to any value to enable nightly builds. All instances will be migrated to nightly builds on next image start. Unset this variable to go back to MainLine builds (stable releases). | UNSET | - ## Volumes -| Mount Point | Description | -|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `/home/amp/.ampdata` | **Required!** This volume contains everything AMP needs to run. This includes all your instances, all their game files, the web ui sign-in info, etc. Essentially, without creating this volume, AMP will be wiped on every boot.| +| Mount Point | Description | +|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `/home/amp/.ampdata` | **Required!** This volume contains everything AMP needs to run. This includes all your instances, all their game files, the web ui sign-in info, etc. Essentially, without creating this volume, AMP will be wiped on every boot. | +| `/home/amp/scripts` | This volume allows you to provide custom scripts that will run at certain points during this container's lifecycle. See the section below about custom scripts. | + +### Custom Scripts + +If you would like to run your own shell scripts in this container, which can be useful to e.g. install extra dependencies for a game's plugin, you can use the `/home/amp/scripts` volume. + +Currently, only one script is supported: `startup.sh`. Place a file named `startup.sh` into the volume, and it will be run on container startup. + +**Example: Installing extra packages** +```sh +echo "Downloading dependencies for Valheim Plus Mod..." +apt-get update && \ +apt-get install -y \ + libc6 \ + libc6-dev +``` ## HTTPS / SSL / TLS