MitchTalmadge / AMP-dockerized

CubeCoders AMP in a Docker Image. Easily create game servers for games like Minecraft, GMod, TF2, Factorio, and StarBound!
https://hub.docker.com/r/mitchtalmadge/amp-dockerized
Other
89 stars 21 forks source link

Created modified Dockerfile for ARM64 build #108

Closed SahajJain01 closed 1 year ago

SahajJain01 commented 2 years ago

Removed srcds dependencies as they don't have arm64 support. Replaced amd64 Java with arm64 Using buildx build was successful but unable to create AMP instance due to failure of fetching arm64 binary for amp.

Logs: ----------------------, Starting AMP-Dockerized..., ----------------------, Note: This is an UNOFFICIAL IMAGE for CubeCoders AMP. This was created by the community, NOT CubeCoders., Please, DO NOT contact CubeCoders (Discord or otherwise) for technical support when using this image., They do not support nor endorse this image and will not help you., Instead, please direct support requests to https://github.com/MitchTalmadge/AMP-dockerized/issues., We are happy to help you there!, Thank you!!, ----------------------, , Copying AMP Core..., Ensuring AMP user exists..., Adding group amp' (GID 124) ..., Done., Adding system useramp' (UID 1001) ..., Adding new user amp' (UID 1001) with groupamp' ..., Not creating home directory `/home/amp'., Ensuring correct file permissions..., Setting timezone from TZ env var..., , Current default time zone: 'Asia/Kolkata', Local time is now: Wed Jan 5 10:43:34 IST 2022., Universal Time is now: Wed Jan 5 05:13:34 UTC 2022., , Making sure Main instance exists..., Creating Main instance... (This can take a while), [Info] AMP Instance Manager v2.3.0.8 built 21/12/2021 17:18, [Info] Release spec: Release (aarch64) - built by CUBECODERS/buildbot on CCL-DEV, [Info] Testing internet connection..., [Info] Checking licence key..., [Info] Licence Type: AMP Professional, [Info] Current Usage: 1, [Info] Creating Instance: 'Main', [Info] Performing Step: Creating Environment, [Activity] Audit: Unknown/None [CreateInstance] Created instance Main using ADS module on port 8080., [Info] Performing Step: Downloading AMP, [Info] Using cached archive: /home/amp/.ampdata/instances/AMPCache-2308.zip, [Info] Performing Step: Unpacking, [Error] Download or unpack failed. Please check your network connection and try again., [Error] AMP_Linux_aarch64 does not exist!, [Info] Performing Step: Failed, [Info] Instance creation failed. The core archive failed to download or unpack, Setting all instances to use MainLine updates..., Upgrading Instances..., [Info] AMP Instance Manager v2.3.0.8 built 21/12/2021 17:18, [Info] Release spec: Release (aarch64) - built by CUBECODERS/buildbot on CCL-DEV, [Info] There are no instances to update., Ensuring Main Instance will Start on Boot..., Starting AMP..., [Info] AMP Instance Manager v2.3.0.8 built 21/12/2021 17:18, [Info] Release spec: Release (aarch64) - built by CUBECODERS/buildbot on CCL-DEV, [Info] No AMP instances are currently set to start automatically on boot., AMP Started., ----------------------, NOTICE: Java 17 is now the default in this image. Java 16 has been removed in preference of Java 17, which is LTS., Use the Java Configuration section in the AMP Web UI to select a specific version. Otherwise, Java 17 will be used automatically., ----------------------, Entrypoint Sleeping. Logs can be viewed through AMP web UI or at ampdata/instances/Main/AMP_Logs

rekonnected commented 1 year ago

After doing a bunch of very janky experimentation trying to work around the issue of not having AMP_Linux_AArch64 as an executable, I noticed from a fresh install of my final iteration that it automatically tried to download from a different link: https://cubecoders.com/Downloads/Release/AMP_Latest_aarch64.zip.

This lead me down a long path that eventually ended up in only needing to change some hardcoded amd64 bits to AArch64/arm64, to change the CubeCoders repo url to be http://repo.cubecoders.com/aarch64 (just added aarch64 before debian/) and to comment out dependencies that can't install (scrds stuff). Need to find alternatives for those if we can, but Minecraft works so one of its most common modules is good. Attached is the modified Dockerfile I used to successfully build a working AArch64 image. No other files were changed. Had to change the file extension to .txt to get GitHub to let me upload it.

Dockerfile.txt

EDIT: Now all we need to do really is figure out how to automate a hybrid build, either 2 images (amd64/arm64) or a combined universal image if that's possible? The former may be the easier solution in the short term, just have two build processes (or one that filters by arch and picks a dockerfile/changes hardcoded arch in links) and have them upload one image tagged amd64 and the other tagged arm64, I think. I could be quite wrong, I didn't actually know much about docker build stuff until I took a look at this. I'm looking into arch-agnostic build setup stuff now, I'll update when I know more unless someone else figures it out before me.

rekonnected commented 1 year ago

take a look at my pull req that should enable automatic arm64/amd64 builds simultaneously, just put it up: https://github.com/MitchTalmadge/AMP-dockerized/pull/140

MitchTalmadge commented 1 year ago

Sorry for never getting back to you on this, thank you for all the time you spent working on it. I'm closing this in favor of #140, but I can re-open it if there's something in here that I missed which #140 does not have. Thank you again! ❤️ You're awesome!