steamcmd / docker

Docker image containing SteamCMD
https://hub.docker.com/r/steamcmd/steamcmd
MIT License
145 stars 20 forks source link

ARM Support? #73

Open joaop221 opened 3 months ago

joaop221 commented 3 months ago

Is there any plan to add ARM support to this images?

jonakoudijs commented 3 months ago

Sadly steamcmd itself is not ARM compatible. Therefor it would not really make sense to create ARM images without major changes to the images itself. Several steamcmd-based game server projects that support ARM seem to be using an emulator like fex and qemu.

I am not sure if implementing an emulator in base images like this would be useful seeing in my experience different game servers work on different emulators and even behave differently on specific emulator versions. But I am open to suggestions on a standard or base to more easily support ARM which works for most of the projects.

joaop221 commented 2 months ago

Hi @jonakoudijs after some tests and pocs I achived some results using Debian images, with multi arch support and box84 emulator, that integrates with wine (There is a box64 + wine64 support too).

I have an example here: https://github.com/joaop221/v-rising-docker-arm64

If you believe that this implementation is valid, I ask to reopen this issue and I'll work to adapt debian images with these features.

torarnv commented 1 month ago

Just dropping it here that although Apple Silicon Macs can do Rosetta-translation of x86_64 binaries, even for Linux VMs, it doesn't help as long as the steamcmd binary is 32-bit only, as Rosetta only translates 64-bit x86 binaries.

With colima start --vz-rosetta --vm-type vz --mount-type virtiofs, the entrypoint is run via Rosetta:

root@68acdc72adff:~# ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  0 15:21 pts/0    00:00:00 /mnt/lima-rosetta/rosetta /bin/bash
root          23       1 83 15:22 pts/0    00:00:00 /usr/bin/ps -ef

But launching steamcmd still fails:

root@68acdc72adff:~# /root/.local/share/Steam/steamcmd/linux32/steamcmd
bash: /root/.local/share/Steam/steamcmd/linux32/steamcmd: cannot execute binary file: Exec format error
joaop221 commented 1 month ago

Hi @torarnv to run steamcmd you'll need to specift LD_LIBRARY_PATH variable with linux32 binaries ref and use one emulator. e.g.:

export LD_LIBRARY_PATH="/home/steam/linux32:"
box86 /home/steam/linux32/steamcmd
jonakoudijs commented 1 month ago

Hi @joaop221 awesome work! Sorry for the delayed reply, some personal matters have consumped a lot of time and energy recently.

Let’s continue to work on this. My suggestion is to create 1 new tag for this seeing it will contain extra configuration and packages. Ideally Ubuntu is used as a base image seeing the default is Ubuntu as well but if Debian works better in this case then that is fine.

torarnv commented 1 month ago

Thanks @joaop221! Yeah, I figured that eventually, using qemu-i386. Unfortunately it fails due to https://gitlab.com/qemu-project/qemu/-/issues/2424. If box86 does not internally use QEMU then perhaps that would be a working alternative.

In the end I opted for https://github.com/sonroyaalmerol/steam-depot-downloader to download the game, after trying https://github.com/sonroyaalmerol/steamcmd-arm64.

That worked for installing the game, but running the game (which is supposed to be all x86_64, and hence work under Rosetta) fails due to https://github.com/mono/mono/issues/21423.