项目作者: CM2Walki

项目描述 :
Dockerfile for automated build of a Valheim gameserver: https://hub.docker.com/r/cm2network/valheim/
高级语言: Shell
项目地址: git://github.com/CM2Walki/Valheim.git
创建时间: 2021-03-23T19:12:17Z
项目社区:https://github.com/CM2Walki/Valheim

开源协议:MIT License

下载


Docker Cloud Build Status Docker Stars Docker Pulls Discord

Supported tags and respective Dockerfile links

What is Valheim?

A brutal exploration and survival game for 1-10 players, set in a procedurally-generated purgatory inspired by viking culture. Battle, build, and conquer your way to a saga worthy of Odin’s patronage!

Valheim

logo

How to use this image

Hosting a simple game server

Running on the host interface (recommended):

  1. $ docker run -d --net=host --name=valheim-dedicated cm2network/valheim

Running using a bind mount for data persistence on container recreation:

  1. $ mkdir -p $(pwd)/valheim-data
  2. $ chmod 777 $(pwd)/valheim-data # Makes sure the directory is writeable by the unprivileged container user
  3. $ docker run -d --net=host -v $(pwd)/valheim-data:/home/steam/valheim-dedicated/ --name=valheim-dedicated cm2network/valheim
  4. ---
  5. $ docker volume create valheim-plus-data # For valheim:plus - Create an additional world volume
  6. $ docker run -d --net=host -v $(pwd)/valheim-data:/home/steam/valheim-dedicated/ -v valheim-plus-data:/home/steam/.config/unity3d/IronGate/Valheim/ --name=valheim-plus-dedicated cm2network/valheim:plus

Running multiple instances (increment SERVER_PORT by two, there is no way to overwrite the steam query port, it will always be SERVER_PORT + 1!):

  1. $ docker run -d --net=host -e SERVER_PORT=2458 --name=valheim-dedicated2 cm2network/valheim

It’s also recommended to use “—cpuset-cpus=” to limit the game server to a specific core & thread.

The container will automatically update the game on startup, so if there is a game update just restart the container.

Configuration

Environment Variables

Feel free to overwrite these environment variables, using -e (—env):

  1. SERVER_PORT=2456 (Game Port (tcp & udp); Steam Query Port (udp) will be SERVER_PORT + 1)
  2. SERVER_PUBLIC=1
  3. SERVER_WORLD_NAME="BraveNewWorld"
  4. SERVER_PW="changeme"
  5. SERVER_NAME="New \"${STEAMAPP}\" Server"
  6. SERVER_LOG_PATH="logs_output/outputlog_server.txt"
  7. SERVER_SAVE_DIR="Worlds"
  8. SCREEN_QUALITY="Fastest"
  9. SCREEN_WIDTH=640
  10. SCREEN_HEIGHT=480
  11. STEAMCMD_UPDATE_ARGS="" (Gets appended here: +app_update [appid] [STEAMCMD_UPDATE_ARGS]; Example: "validate")
  12. ADDITIONAL_ARGS="" (Pass additional arguments to the server. Make sure to escape correctly!)

If you want to learn more about configuring a Valheim server check this documentation.

Config

You can find the adminlist.txt, bannedlist.txt and permittedlist.txt here: /home/steam/valheim-dedicated/Worlds.

The world database files can be found in:

  • /home/steam/valheim-dedicated/Worlds/worlds for tag valheim:latest
  • /home/steam/.config/unity3d/IronGate/Valheim/ for tag valheim:plus

Image Variants:

The valheim images come in two flavors, each designed for a specific use case.

valheim:latest

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is a bare-minimum Valheim dedicated server containing no 3rd party plugins.

valheim:plus

This is a specialized image. It contains the popular mod ValheimPlus.

Note: The game world is saved in a different directory in this tag, make sure to create an additional volume for world persistency across container recreations. See #Hosting a simple game server

Contributors

Contributors Display