Skip to content

Commit a6ff5c0

Browse files
Merge pull request #90 from MitchTalmadge/staging
SDL and Custom Scripts
2 parents 62e24fd + 7a6e91b commit a6ff5c0

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ RUN dpkg --add-architecture i386 && \
107107
libcurl3-gnutls:i386 \
108108
libcurl4 \
109109
libncurses5:i386 \
110+
libsdl2-2.0-0 \
110111
libsdl2-2.0-0:i386 \
111112
libtinfo5:i386 \
112113
# --------------------

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,27 @@ Example: `TZ=America/Denver`
163163
|-------|----------------------------------------------------------------------|---------------|
164164
| `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 |
165165

166-
167166
## Volumes
168167

169-
| Mount Point | Description |
170-
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
171-
| `/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.|
168+
| Mount Point | Description |
169+
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
170+
| `/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. |
171+
| `/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. |
172+
173+
### Custom Scripts
174+
175+
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.
176+
177+
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.
178+
179+
**Example: Installing extra packages**
180+
```sh
181+
echo "Downloading dependencies for Valheim Plus Mod..."
182+
apt-get update && \
183+
apt-get install -y \
184+
libc6 \
185+
libc6-dev
186+
```
172187

173188
## HTTPS / SSL / TLS
174189

entrypoint/main.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ echo "Thank you!!"
1313
echo "----------------------"
1414
echo ""
1515

16+
# Run user startup script
17+
STARTUP_SCRIPT="/home/amp/scripts/startup.sh"
18+
if [ -f ${STARTUP_SCRIPT} ]; then
19+
echo "Running startup script..."
20+
chmod +x ${STARTUP_SCRIPT}
21+
/bin/bash ${STARTUP_SCRIPT}
22+
fi
23+
1624
# Copy the pre-cached AMP Core from the image into the location AMP expects.
1725
# This will allow upgrades to use the cache and not need to do any downloads.
1826
echo "Copying AMP Core..."

0 commit comments

Comments
 (0)