norimicry / stardew-multiplayer-docker

Run a Stardew Valley Multiplayer Server with docker-compose
94 stars 23 forks source link

[REQUEST]: Support for arm architecture #17

Closed FedeZet closed 6 months ago

FedeZet commented 6 months ago

Is your feature request related to a problem? Please describe. It will be possible that you can provide support for systems with Arm architecture, I have a server that unfortunately has this architecture, and due to package problems when installing, an error occurs. I attach a screenshot, I imagine that must be the problem because I tried with a server with x86 and it worked well for me, but I can't use it due to lack of resources. If it is not possible, thank you anyway.

Captura de pantalla 2024-04-23 215710

roscoejp commented 6 months ago

The base image here doesn't support arm. Newer manifests of the image are built with arm support. debian-11-v4.0.0 may be a good starting point for updating the image to a (somewhat) more recent tag.

Edit: Updating base image lets build complete but container crashes on startup. Will investigate tomorrow.

[+] Building 102.5s (18/18) FINISHED                                                                                           docker:rancher-desktop
 => [valley internal] load build definition from Dockerfile                                                                                      0.0s
 => => transferring dockerfile: 1.83kB                                                                                                           0.0s
 => [valley internal] load .dockerignore                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                  0.0s
 => [valley internal] load metadata for docker.io/jlesage/baseimage-gui:debian-11-v4.0.0                                                         2.4s
 => CACHED [valley  1/13] FROM docker.io/jlesage/baseimage-gui:debian-11-v4.0.0@sha256:4dc445f94d924508190f98831d87eeea493918a5906f7590c1099c13  0.0s
 => [valley internal] load build context                                                                                                         0.0s
 => => transferring context: 2.93kB                                                                                                              0.0s
 => [valley  2/13] RUN apt-get update && apt-get install -y wget unzip tar strace mono-complete xterm gettext-base jq netcat procps && apt-get  56.2s
 => [valley  3/13] RUN mkdir -p /data/Stardew &&     mkdir -p /data/nexus &&     wget --user-agent="Mozilla" https://mirror.cloudcraft.info/St  12.6s 
 => [valley  4/13] RUN wget -qO dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/d4b71fac-a2fd-4516-ac58-100fb09d796a/e79  19.5s 
 => [valley  5/13] RUN wget --user-agent="Mozilla" https://mirror.cloudcraft.info/SMAPI_latest.tar.gz -qO /data/nexus.tar.gz &&     tar xf /dat  2.8s 
 => [valley  6/13] COPY [mods/, /data/Stardew/game/Mods/]                                                                                        0.0s 
 => [valley  7/13] COPY scripts/ /opt/                                                                                                           0.0s 
 => [valley  8/13] RUN chmod +x /data/Stardew/game/StardewValley &&     chmod -R 777 /data/Stardew/ &&     chown -R 1000:1000 /data/Stardew &&   5.0s 
 => [valley  9/13] RUN mkdir /etc/services.d/utils && touch /etc/services.d/app/utils.dep                                                        0.3s
 => [valley 10/13] COPY run /etc/services.d/utils/run                                                                                            0.0s
 => [valley 11/13] RUN chmod +x /etc/services.d/utils/run                                                                                        0.3s
 => [valley 12/13] COPY docker-entrypoint.sh /startapp.sh                                                                                        0.0s
 => [valley 13/13] RUN chmod +x /startapp.sh                                                                                                     0.3s
 => [valley] exporting to image                                                                                                                  3.0s
 => => exporting layers                                                                                                                          3.0s
 => => writing image sha256:f362df3e4eec881a668a56995d8912a494daa4cd32077fe2539c9588405837de                                                     0.0s
 => => naming to docker.io/library/stardew-multiplayer-docker-valley  
pinduzera commented 6 months ago

As far as I know, Stardew doesn't have an official ARM support (other than the mobile version). But, digging a little in the darkness of the internet and Wayback machine you can get this, hope it helps: https://web.archive.org/web/20200115233340/https://ur.gs/post/stardew-valley/

roscoejp commented 6 months ago

This is actually what I was trying a bit last night. I got the container started using the debaign-11-v4 tag (v4.0.0 had some missing tigervnc bits) and then started working my way through the dependency list - knowing someone else tried something similar I'll follow along and see how far I get.

Alternatively - I'm running this on a M2 chipset and they supposedly support amd64 emulation. I haven't played with it much (and I'm stuck using Rancher for reasons) but this might be another approach. This would probably be the more tedious approach and would also limit to M1/2/3 chips wrt ARM support.

FedeZet commented 6 months ago

Using the debian-11-v4.2 tag the build works without errors and when running VNC I have no problems. But I did have two problems, when entering through the website the screen appears gray, the same for TightVNC. Additionally, there is a SMAPI message loop waiting for the log. There is a bug about a "./Stardew Valley" folder not being found and the "sw-vers" command also not being found.

Captura de pantalla 2024-04-24 154518 Captura de pantalla 2024-04-24 154641

roscoejp commented 6 months ago

Yeah I didn't get very far on this today. Getting into the container you can actually see that the Stardew binary never starts. This comes back to the "It wasn't really intended for ARM" motif before. It seems to be "just a missing dependency" based on the errors but still trying to work through it. docker exec -it stardew /bin/bash will actually let you into the container to start poking around if you're interested in doing that after it's been started. Most of the good stuff is mounted in the /data/Stardew dir.

norimicry commented 6 months ago

The "sw_vers" warning shows up even on a working version so you can ignore that. The looping "Waiting for SMAPI logs" is indicating that SMAPI is not being loaded onto the server correctly.

Making this compatible for ARM architecture is not currently a priority on my list unfortunately due to the effort required. I had noticed someone created a fork in attempt for ARM support but I have no idea the progress he made but it may be worth taking a look at: https://github.com/CriDos/stardew-multiplayer-docker

Good luck and appreciate @roscoejp looking into this.