docker: Update documentation for officially provided Docker images

This commit is contained in:
Tim Schumacher 2025-01-04 14:36:58 +01:00
parent cbdae5b15e
commit d54711651b

View file

@ -14,32 +14,27 @@ Open ports can also be passed through using `-p <host_port>:<container_port>`.
For Example: For Example:
```bash ```bash
# Building the image using buildx and loading it into docker
docker buildx build -t tshock:latest --load .
# Running the image
docker run -p 7777:7777 -p 7878:7878 \ docker run -p 7777:7777 -p 7878:7878 \
-v /home/cider/tshock/:/tshock \ -v /home/cider/tshock/:/tshock \
-v /home/cider/.local/share/Terraria/Worlds:/worlds \ -v /home/cider/.local/share/Terraria/Worlds:/worlds \
-v /home/cider/tshock/plugins:/plugins \ -v /home/cider/tshock/plugins:/plugins \
--rm -it tshock:latest \ --rm -it ghcr.io/pryaxis/tshock:latest \
-world /worlds/backflip.wld -motd "OMFG DOCKER" -world /worlds/backflip.wld -motd "OMFG DOCKER"
``` ```
## Building for Other Platforms ## Building custom images
Using `docker buildx`, you could build [multi-platform images](https://docs.docker.com/build/building/multi-platform/) for TShock. Occasionally, it may be necessary to adjust TShock with customizations that are not included in the upstream project.
Therefore, these changes are also not available in the officially provided Docker images.
To build and load a Docker image from your local checkout, use the following `buildx` command:
For Example:
```bash ```bash
# Building the image using buildx and loading it into docker docker buildx build -t tshock:latest --load .
docker buildx build -t tshock:linux-arm64 --platform linux/arm64 --load . ```
# Running the image It is also possible to build [multi-platform images](https://docs.docker.com/build/building/multi-platform/) for TShock (e.g. an image targeting `arm64`, on a host that is not `arm64`):
docker run -p 7777:7777 -p 7878:7878 \
-v /home/cider/tshock/:/tshock \ ```bash
-v /home/cider/.local/share/Terraria/Worlds:/worlds \ docker buildx build -t tshock:linux-arm64 --platform linux/arm64 --load .
-v /home/cider/tshock/plugins:/plugins \
--rm -it tshock:linux-arm64 \
-world /worlds/backflip.wld -motd "ARM64 ftw"
``` ```