valheim-server-docker icon indicating copy to clipboard operation
valheim-server-docker copied to clipboard

Upgrade to Debian 13 (trixie) base image.

Open JustinTArthur opened this issue 4 months ago • 22 comments

Debian 13 (trixie) is the release marked stable and includes glibc 2.41.

  • To better align with the newer Python infrastructure, the changes switch from using setuptools to using pip as both the build frontend and delivery system for built Python assets. A virtualenv is used for the tox tests.
  • Debian 13's shellshock version identifies new issues in the server scripts through deeper branch analysis. A couple scripts are updated to ignore unused branch checks for trap-invoked code and a few more variable references are double-quoted.
  • A minor change is made to the awk call for port listening as Debian 13 has a newer mawk
  • The busybox build is configured to not compile the tc (traffic control) applet. It references macros not found in the Linux C header files included in Debian 13.

This replaces lloesche/valheim-server-docker#753 which covered an upgrade to bookworm but the community had not heard from Lukas before Debian released trixie. This is part 1 of 2 for supporting the newer releases of ghorsington's BepInEx pack for Valheim as detailed in lloesche/valheim-server-docker#752.

JustinTArthur avatar Aug 17 '25 10:08 JustinTArthur

I've tested your update-libdoorstop-env-var-scheme branch on my server for a few days now. Apart from supervisord being unable to detect an open UDP-port 2457 (see below), it works flawlessly. This seems like a solid PR! 👍👍

supervisord: valheim-server DEBUG - [122775] - Waiting for server to listen on UDP query port 2457

SnorreSelmer avatar Aug 19 '25 16:08 SnorreSelmer

I've tested your update-libdoorstop-env-var-scheme branch on my server for a few days now. Apart from supervisord being unable to detect an open UDP-port 2457 (see below), it works flawlessly. This seems like a solid PR! 👍👍

Nice. Thanks for testing! You may want to git pull --rebase and rebuild if you have have it checked out on a local clone.

That branch has served as a staging area for the part 2 PR if @lloesche merges this one. I force-pushed to it recently to sync the trixie changes (including a fix for query port listen detection when not using Crossplay).

JustinTArthur avatar Aug 20 '25 04:08 JustinTArthur

Pulled and tested the updated "part 2", 👍👍. Can't wait for this to be merged.

SnorreSelmer avatar Aug 20 '25 16:08 SnorreSelmer

Thank you for this ! The update-libdoorstop-env-var-scheme branch works like a charm since yesterday, i'll update this comment if anything comes up.

chrisisth avatar Aug 25 '25 11:08 chrisisth

tldr: I was pulling the wrong branch. Letting my arrogance show, I'll edit and report back when I build the image and test.

Hey all, I cloned your repo and tried build the docker image. I got this error:

valheim:~/valheim-server-docker# docker build -t trixie-valheim:latest .
[+] Building 3.7s (9/54)                                                                                                                                                     docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                   0.1s
 => => transferring dockerfile: 7.53kB                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye-slim                                                                                                                0.5s
 => [internal] load metadata for docker.io/library/debian:buster-slim                                                                                                                  0.4s
 => [internal] load .dockerignore                                                                                                                                                      0.1s
 => => transferring context: 288B                                                                                                                                                      0.0s
 => CACHED [build-env  1/42] FROM docker.io/library/debian:bullseye-slim@sha256:849d9d34d5fe0bf88b5fb3d09eb9684909ac4210488b52f4f7bbe683eedcb851                                       0.0s
 => [internal] load build context                                                                                                                                                      0.2s
 => => transferring context: 1.20kB                                                                                                                                                    0.0s
 => CACHED [i386-libs 1/2] FROM docker.io/library/debian:buster-slim@sha256:bb3dc79fddbca7e8903248ab916bb775c96ec61014b3d02b4f06043b604726dc                                           0.0s
 => ERROR [i386-libs 2/2] RUN apt-get update     && apt-get -y --no-install-recommends install     libc6-dev     libstdc++6     libsdl2-2.0-0     libcurl4     && rm -rf /var/lib/apt  1.8s
 => CANCELED [build-env  2/42] RUN apt-get update                                                                                                                                      2.3s
------
 > [i386-libs 2/2] RUN apt-get update     && apt-get -y --no-install-recommends install     libc6-dev     libstdc++6     libsdl2-2.0-0     libcurl4     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*:
1.252 Ign:1 http://deb.debian.org/debian buster InRelease
1.284 Ign:2 http://deb.debian.org/debian-security buster/updates InRelease
1.317 Ign:3 http://deb.debian.org/debian buster-updates InRelease
1.349 Err:4 http://deb.debian.org/debian buster Release
1.349   404  Not Found [IP: 151.101.2.132 80]
1.377 Err:5 http://deb.debian.org/debian-security buster/updates Release
1.378   404  Not Found [IP: 151.101.2.132 80]
1.410 Err:6 http://deb.debian.org/debian buster-updates Release
1.410   404  Not Found [IP: 151.101.2.132 80]
1.413 Reading package lists...
1.423 E: The repository 'http://deb.debian.org/debian buster Release' does not have a Release file.
1.423 E: The repository 'http://deb.debian.org/debian-security buster/updates Release' does not have a Release file.
1.423 E: The repository 'http://deb.debian.org/debian buster-updates Release' does not have a Release file.
------
Dockerfile:98
--------------------
  97 |     ENV DEBIAN_FRONTEND=noninteractive
  98 | >>> RUN apt-get update \
  99 | >>>     && apt-get -y --no-install-recommends install \
 100 | >>>     libc6-dev \
 101 | >>>     libstdc++6 \
 102 | >>>     libsdl2-2.0-0 \
 103 | >>>     libcurl4 \
 104 | >>>     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 105 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update     && apt-get -y --no-install-recommends install     libc6-dev     libstdc++6     libsdl2-2.0-0     libcurl4     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*" did not complete successfully: exit code: 100
valheim:~/valheim-server-docker#

Any suggestions on how to fix that?

StevenAlexanderJohnson avatar Aug 31 '25 23:08 StevenAlexanderJohnson

Hey all, I cloned your repo and tried build the docker image. I got this error

It doesn't look like you've checked out this PR. Did you clone lloesche's repo or my fork?

If you cloned lloesche's repo, you can

cd valheim-server-docker
git remote add JustinTArthur https://github.com/JustinTArthur/valheim-server-docker.git
git fetch JustinTArthur

# If you want to build, test, or review this PR (part 1, infrastructure upgrades only):
git checkout --track JustinTArthur/upgrade-to-trixie
docker build …

# Or if you just want a working image (part 2, part 1 + new libdoorstop fixes):
git checkout --track JustinTArthur/update-libdoorstop-env-var-scheme
docker build …

If you cloned my fork instead, then just git checkout upgrade-to-trixie or git checkout update-libdoorstop-env-var-scheme depending on what you want.

JustinTArthur avatar Sep 01 '25 00:09 JustinTArthur

It doesn't look like you've checked out this PR. Did you clone lloesche's repo or my fork?

Yep I was cloning your repo but didn't switch to the branch with the fix. I also found that the built image is huge. I looked through the Dockerfile and I can't find necessarily why that is, is it because build dependencies are shipped with the final image?

I don't know all of what this project does because I've just started looking at it today. I was going to run on a VM with 6 gigs of storage, but the built image takes up over a quarter, then the actual docker container downloads more and uses up the rest of the space.

StevenAlexanderJohnson avatar Sep 01 '25 02:09 StevenAlexanderJohnson

I just cloned and built @JustinTArthur 's update-libdoorstop-env-var-scheme branch and played for several hours. It seems to work well and overcomes https://github.com/lloesche/valheim-server-docker/issues/752

I hope this can be merged, otherwise we might be migrating to a new fork permanently now.

chrisl8 avatar Sep 02 '25 03:09 chrisl8

Would be nice if @lloesche could have invited a couple of trusted contributors to this repo to help review and merge stuff to make this image a true community-build. This is after all the image "everyone" uses.

SnorreSelmer avatar Sep 02 '25 06:09 SnorreSelmer

I don't know all of what this project does because I've just started looking at it today. I was going to run on a VM with 6 gigs of storage, but the built image takes up over a quarter, then the actual docker container downloads more and uses up the rest of the space.

Some sub-dependencies for the packages this image uses (especially for libsdl) have grown large. If this PR is accepted, I'm happy to optimize for size in a separate PR or two.

As to what the image does, one of the first things it does is download Valheim Dedicated Server. Not much we can do about Dedicated Server taking up 1.73 GB (possibly more during an upgrade). While the server is free cost-wise, only Coffee Stain has publishing rights for the server assets in territories this image would be distributed, so it must be downloaded via their distribution channel (Steam). Gratis vs Libre

JustinTArthur avatar Sep 02 '25 07:09 JustinTArthur

Would be nice if @lloesche could have invited a couple of trusted contributors to this repo to help review and merge stuff to make this image a true community-build. This is after all the image "everyone" uses.

For sure, but things get away from people. This is what forking is for.

I'm just glad it is all openly available source code so we can keep using it even if the author disappears.

chrisl8 avatar Sep 02 '25 16:09 chrisl8

UPDATE I removed these two lines from the environment section of my compose.yaml file and it works fine now:

       - PUID=1029
       - PGID=1029

Those were leftover from before. I'm not sure if they were part of the docs or just a dumb mistake on my part.

@JustinTArthur FYI: I'm getting some permission errors today when I tried to restart the container:

valheim  | Sep  2 11:45:18 supervisord: valheim-backup /usr/local/bin/valheim-backup: line 6: /usr/local/etc/valheim/defaults: Permission denied
valheim  | Sep  2 11:45:18 supervisord: valheim-backup /usr/local/bin/valheim-backup: line 7: /usr/local/etc/valheim/common: Permission denied
valheim  | Sep  2 11:45:18 supervisord: valheim-backup /usr/local/bin/valheim-backup: line 160: info: command not found
valheim  | 2025-09-02 11:45:18,694 INFO waiting for valheim-backup to stop
valheim  | 2025-09-02 11:45:18,694 WARN stopped: valheim-backup (terminated by SIGTERM)
valheim  | Sep  2 11:45:19 supervisord: valheim-bootstrap valheim-backup: ERROR (abnormal termination)
valheim  | 2025-09-02 11:45:19,716 INFO exited: valheim-bootstrap (exit status 0; expected)
valheim  | 2025-09-02 11:45:20,718 INFO spawned: 'valheim-updater' with pid 71
valheim  | Sep  2 11:45:20 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 8: /usr/local/etc/valheim/defaults: Permission denied
valheim  | Sep  2 11:45:20 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 9: /usr/local/etc/valheim/common: Permission denied
valheim  | Sep  2 11:45:20 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 11: debug: command not found
valheim  | Sep  2 11:45:20 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 37: info: command not found
valheim  | Sep  2 11:45:20 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 38: check_lock: command not found
valheim  | 2025-09-02 11:45:20,726 WARN exited: valheim-updater (exit status 127; not expected)
valheim  | 2025-09-02 11:45:24,449 INFO spawned: 'valheim-updater' with pid 88
valheim  | Sep  2 11:45:24 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 8: /usr/local/etc/valheim/defaults: Permission denied
valheim  | Sep  2 11:45:24 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 9: /usr/local/etc/valheim/common: Permission denied
valheim  | Sep  2 11:45:24 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 11: debug: command not found
valheim  | Sep  2 11:45:24 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 37: info: command not found
valheim  | Sep  2 11:45:24 supervisord: valheim-updater /usr/local/bin/valheim-updater: line 38: check_lock: command not found
valheim  | 2025-09-02 11:45:24,458 WARN exited: valheim-updater (exit status 127; not expected)
valheim  | 2025-09-02 11:45:25,459 INFO gave up: valheim-updater entered FATAL state, too many start retries too quickly

It seems like /usr/local/etc/valheim is world read/writeable, but the common and 'defaults` folders within are not:

root@66be9ed2b79c:/# ls -la /usr/local/etc
total 40
drwxr-xr-x 1 root root    4096 Sep  2 11:36 .
drwxr-xr-x 1 root root    4096 Sep  2 11:34 ..
-rw-r--r-- 1 root root      26 Sep  2 11:36 build.date
-rw-r--r-- 1 root root       8 Sep  2 11:34 git-commit.HEAD
drwxr-xr-x 1 root root    4096 Sep  2 11:34 supervisor
-rw-r----- 1 root valheim 2486 Sep  1 18:51 supervisord.conf
drwxr-xr-x 2 root root    4096 Sep  2 11:34 valheim
root@66be9ed2b79c:/# ls -la /usr/local/etc/valheim/
total 40
drwxr-xr-x 2 root root  4096 Sep  2 11:34 .
drwxr-xr-x 1 root root  4096 Sep  2 11:36 ..
-rw-rw---- 1 root root 17487 Sep  1 18:58 common
-rw-rw---- 1 root root  7116 Sep  1 18:51 defaults

This could be just a personal configuration issue, or those errors might not even be the failure case, but I thought I'd post this here in case it is an image issue.

chrisl8 avatar Sep 02 '25 16:09 chrisl8

@JustinTArthur FYI: I'm getting some permission errors today when I tried to restart the container:

Those permissions don't line up with what's in git. Is it possible this was cloned outside of Linux or using something other than git before the build? If you're using Microsoft Windows to manage the working dir for the build (which I don't recommend), make sure to restore the real permissions in NTFS metadata before the build: https://learn.microsoft.com/en-us/windows/wsl/file-permissions

If using git in Linux, git status -v might help determine what permissions changed in your working dir. If using the zip from GitHub in Linux instead, I would recommend using Info-ZIP's unzip CLI as it maintains unix system permissions.

JustinTArthur avatar Sep 03 '25 04:09 JustinTArthur

@JustinTArthur Thank you so much for the suggestions! I will look into that. Clearly I messed something up. I was too hasty to report it before debugging the issue.

The bottom line is that this PR is working great!

chrisl8 avatar Sep 03 '25 12:09 chrisl8

I've restored the ancient 32-bit glibc the image's SteamCMD uses to support Linux 3.x-based Synology DSM variants. These OSes are found on Synology's older appliances. See https://github.com/ValveSoftware/steam-for-linux/issues/8083#issuecomment-1355716966 and the DSM<->Linux version matrix.

Dedicated Server and BepInEx still use trixie's new glibc. If the modern parts still work on those Synology DSMs without syscall conflicts, I'll be shocked. I welcome the smaller change size on this PR either way.

In the meantime, I've not heard from Lukas. Folks have tried @-mentions and I've emailed. I'll give it a couple days, but may perma-fork the repo and image if there's no word.

JustinTArthur avatar Sep 06 '25 08:09 JustinTArthur

Hi,

I'm having problems building this image. Am using the following commands:

user@host:/opt/valheim$ git clone https://github.com/JustinTArthur/valheim-server-docker.git
Cloning into 'valheim-server-docker'...
remote: Enumerating objects: 1235, done.
remote: Counting objects: 100% (419/419), done.
remote: Compressing objects: 100% (85/85), done.
remote: Total 1235 (delta 385), reused 336 (delta 334), pack-reused 816 (from 1)
Receiving objects: 100% (1235/1235), 6.99 MiB | 11.58 MiB/s, done.
Resolving deltas: 100% (758/758), done.
user@host:/opt/valheim$ cd valheim-server-docker/
user@host:/opt/valheim/valheim-server-docker$ git checkout upgrade-to-trixie
branch 'upgrade-to-trixie' set up to track 'origin/upgrade-to-trixie'.
Switched to a new branch 'upgrade-to-trixie'
user@host:/opt/valheim/valheim-server-docker$  podman build --progress=plain --log-level=debug --logfile ../valheim-build.log -t valheim-local:latest .
user@host:/opt/valheim/valheim-server-docker$ sudo podman build --progress=plain --log-level=debug --logfile ../valheim-build_sudo.log -t valheim-local:latest .

valheim-build.log valheim-build_sudo.log

is this because i am trying to use podman instead of docker ? I assume using sudo would eliminate the issue, but there seems to be missing lib?

6d61726b760a avatar Sep 10 '25 21:09 6d61726b760a

is this because i am trying to use podman instead of docker ? I assume using sudo would eliminate the issue, but there seems to be missing lib?

Yes, probably because podman. It's quirky with multi-platform builds like this one. If you build the image with docker, it should work fine with podman run, though. Just be ready for errors from the backup/update cron jobs when they violate podman's default SELinux privilege set (errors that can be worked around).

JustinTArthur avatar Sep 11 '25 07:09 JustinTArthur

In the meantime, I've not heard from Lukas. Folks have tried @-mentions and I've emailed. I'll give it a couple days, but may perma-fork the repo and image if there's no word.

Assuming that you want to keep maintaining this and you don't mind fielding all of our silly Issues and questions, then I think you should go ahead and "hard" fork this. Just make it clear at the top of your Readme that this is a fork, what it was a fork of, and what your plans are so people finding it can know it is "newer".

You can also continue to make PRs against the original and agree to "return" it if and when that author returns, if you want, but also, this is your work too so you can just move forward, there shouldn't be any "had feelings". That is what Open Source is for.

chrisl8 avatar Sep 11 '25 15:09 chrisl8

In the meantime, I've not heard from Lukas. Folks have tried @-mentions and I've emailed. I'll give it a couple days, but may perma-fork the repo and image if there's no word.

Assuming that you want to keep maintaining this and you don't mind fielding all of our silly Issues and questions, then I think you should go ahead and "hard" fork this. Just make it clear at the top of your Readme that this is a fork, what it was a fork of, and what your plans are so people finding it can know it is "newer".

@JustinTArthur When perma-forking, it also would make sense to not fork it into a private profile, but instead create a (free) organization and invite some other trusted people, so that the project doesn't run into the same trap again (i.e. the single person with merge rights disappears).

Stammido avatar Sep 11 '25 17:09 Stammido

I wouldn't mind testing and approving changes, but not sure if I'd be comfortable with the responsibilities that come with merge-rights. ;)

SnorreSelmer avatar Sep 12 '25 06:09 SnorreSelmer

Yes, probably because podman. It's quirky with multi-platform builds like this one. If you build the image with docker, it should work fine with podman run, though. Just be ready for errors from the backup/update cron jobs when they violate podman's default SELinux privilege set (errors that can be worked around).

thanks @JustinTArthur, this was correct. after building in docker and it worked fine.

Notably, i needed to use the update-libdoorstop-env-var-scheme branch for some mods (jotunn/xportal) to work

For anyone looking to do this:

# [docker host] build image
git clone https://github.com/JustinTArthur/valheim-server-docker.git
cd valheim-server-docker
git checkout update-libdoorstop-env-var-scheme
sudo docker build --progress=plain --tag valheim-local:$(date +%s) . | tee docker-build_$(date +%s).log

# [docker host] export the image
sudo docker save -o ../valheim-local_1757926359.tar  valheim-local:1757926359
sudo chown -R user:user ../valheim-local_1757926359.tar

# [podman host] copy image from build hoost
scp user@dockerhost:/opt/valheim-server-docker/valheim-local_1757926359.tar .

# [podman host] import image
podman load -i image.tar

6d61726b760a avatar Sep 16 '25 21:09 6d61726b760a

After digging into updating the base image this weekend when I had issues with BepinEx requiring newer GLIBC versions, I just now found that you've already done the heavylifting @JustinTArthur, great work and thank you! I'll be using (and potentially contributing) to your fork instead until this repo gets updated or merged

chippey5 avatar Nov 30 '25 18:11 chippey5