{"id":18843853,"url":"https://github.com/jameslaverack/mrpack-container","last_synced_at":"2025-04-14T07:32:39.184Z","repository":{"id":236836380,"uuid":"590635073","full_name":"JamesLaverack/mrpack-container","owner":"JamesLaverack","description":"Package Modrinth Modpacks (.mrpack files) into runnable container images","archived":false,"fork":false,"pushed_at":"2025-04-12T00:58:24.000Z","size":334,"stargazers_count":6,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T01:39:22.632Z","etag":null,"topics":["containers","minecraft","minecraft-server","modded-minecraft","modrinth","modrinth-modpack","mrpack"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesLaverack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-18T21:19:48.000Z","updated_at":"2025-04-12T00:57:20.000Z","dependencies_parsed_at":"2024-05-13T01:37:00.882Z","dependency_job_id":"cf49b51d-83b2-450f-99fb-3f1cd80a3e81","html_url":"https://github.com/JamesLaverack/mrpack-container","commit_stats":null,"previous_names":["jameslaverack/mrpack-container"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesLaverack%2Fmrpack-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesLaverack%2Fmrpack-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesLaverack%2Fmrpack-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesLaverack%2Fmrpack-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesLaverack","download_url":"https://codeload.github.com/JamesLaverack/mrpack-container/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248839568,"owners_count":21169831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","minecraft","minecraft-server","modded-minecraft","modrinth","modrinth-modpack","mrpack"],"created_at":"2024-11-08T02:59:05.552Z","updated_at":"2025-04-14T07:32:38.854Z","avatar_url":"https://github.com/JamesLaverack.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mrpack-container\n\n[![End to End Test](https://github.com/JamesLaverack/mrpack-container/actions/workflows/e2e.yaml/badge.svg?branch=main)](https://github.com/JamesLaverack/mrpack-container/actions/workflows/e2e.yaml)\n[![Lint](https://github.com/JamesLaverack/mrpack-container/actions/workflows/lint.yaml/badge.svg?branch=main)](https://github.com/JamesLaverack/mrpack-container/actions/workflows/lint.yaml)\n[![Rust Report Card](https://rust-reportcard.xuri.me/badge/github.com/jameslaverack/mrpack-container)](https://rust-reportcard.xuri.me/report/github.com/jameslaverack/mrpack-container)\n\nTurn Modrinth modpack (`.mrpack`) files directly into ready-to-use container images.\n\n- Fast to run (~10–20 seconds)\n- No JVM needed\n- No container runtime (Docker, Podman, etc.) needed\n  \nThe resulting containers are:\n- Small, usually a few hundred MB depending on mods installed\n- Fast to start up, with no downloads on bootup required\n- Security focused, running as non-root with the majority of the filesystem immutable\n- Multi-architecture (AMD64 and ARM64) by default.\n\n## Warnings\n\nYou are responsible for adhering to the licensing requirements of the mod files involved.\nThis project is not affiliated with Modrinth.\nNOT AN OFFICIAL MINECRAFT PRODUCT. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.\n\n## Installing\n\nYou will need to clone this repository with git, and then build the mrpack-container binary with Rust.\nYou will need to have a [Rust toolchain](https://www.rust-lang.org/tools/install) installed for your platform.\n\nFor example:\n```bash\ngit clone https://github.com/JamesLaverack/mrpack-container.git\ncd mrpack-container\ncargo build --release\n```\n\nOr, from inside the `mrpack-container` directory, you can directly build and execute using `cargo run`. \n\n## Building Images\n\nYou need a Modrinth format modpack file (i.e., a `.mrpack` file).\nYou can find these on [Modrinth](https://modrinth.com/modpacks), or use [packwiz](https://packwiz.infra.link/) to convert other formats of modpack to the Modrinth format.\n\n```bash\nmrpack-container --arch amd64 --output ./output my-modpack.mrpack\n```\n\nThe output is in OCI format in the given output directory, but not compressed. You can use `tar` to compress it into a single file: `tar cf - -C ./output .`.\n\nYou can load and execute the produced image directly with a container runtime.\n```bash\ntar cf - -C ./output/ . | podman load\n```\n\nor use [Skopeo](https://github.com/containers/skopeo) to upload it directly to a container runtime:\n```bash\nskopeo copy --format=oci oci:./output docker://registry.example.com/my-modpack:latest\n```\n\n## Multi-Architecture Images\n\nBy default, `mrpack-container` builds native multi-architecture images for both amd64 and arm64 platforms.\nYou can customise this behaviour with the `--arches`/`--arch` flag, as in the above examples.\nSome tools do not work correctly with multi-architecture images.\nIn this case, you will need to either generate an image just for one architecture, or 'split' the image into one per architecture.\nThe different images in a multi-image archive will be named `$version-$arch`, using the provided pack version number.\nFor example, if the modpack `my-modpack.mrpack` is at version 1.2.3:\n\n```bash\nmrpack-container --arches amd64 --arhces arm64 --output ./output my-modpack.mrpack\nskopeo copy oci:output:1.2.3-arm64 oci-archive:arm64.tar\nskopeo copy oci:output:1.2.3-amd64 oci-archive:amd64.tar\n```\n\nWhen building a multi-architecture image, `mrpack-container` will output the container image names in the log output.\n\nYou can also view the image names in the `index.json` file in the output directory.\nFor example:\n\n```bash\njq \u003coutput/index.json '.manifests[] | {arch: .platform.architecture, name: .annotations.\"org.opencontainers.image.ref.name\"}'\n```\n\n## Using Images\n\nYou will need to provide and mount into the running container:\n- A Minecraft server JAR from Mojang, of the correct Minecraft version for your mods and loader, usually mounted at `/usr/lib/minecraft/sever.jar`\n- A file to accept the Minecraft [EULA](https://www.minecraft.net/en-us/eula), usually a text file containing `eula=true` at `/var/minecraft/eula.txt`.\n\nAnd you will probably **want** to mount:\n- A settings file, usually at `/var/minecraft/server.properties`\n- A directory to store the world saves, usually at `/var/minecraft/world`\n\nFor example:\n```bash\n# Minecraft 1.20.1\nwget https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar\n# Doing this means you are accepting the Minecraft EULA\necho \"eula=true\" \u003e eula.txt\nmkdir world\npodman run \\\n  -p 25565:25565 \\\n  -v \"$(pwd)\"/world:/var/minecraft/world \\\n  -v \"$(pwd)\"/server.jar:/usr/lib/minecraft/server.jar:ro \\\n  -v \"$(pwd)\"/eula.txt:/var/minecraft/eula.txt:ro \\\n  \u003cimage_id\u003e\n```\nWill run the server and make it available on `localhost:25565`.\n\n## Container Structure\n\nIn general:\n- `/bin`, `/lib`, and `/usr/` are used for system-level dependencies, i.e., Java.\n- `/usr/local/minecraft` is used for immutable files to do with the Minecraft install.\n- `/var/minecraft` is used for things that are mostly expected to be mutable at runtime.\n\nIn detail:\n- `/bin` with a simlink for `/bin/java` (to `/usr/local/java/bin/java`)\n- `/lib` with the glibc library\n- `/usr/local/java` with the JVM\n- `/usr/local/minecraft/lib` with modloader libraries\n\nThe files and overrides in the Modrinth file are unpacked into `/var/minecraft`.\nPermissions are set as `0755` or `0644`, and most files are owned by root.\nSome files, depending on their name, are set as `0777` or `0666` instead, allowing the Minecraft process to write to them.\n\nThe container is intended to be run with the main process running as uid `1000` and gid `1000`, therefore a number of directories are owned by that user instead:\n- `/var/minecraft`\n- `/var/minecraft/config`\n- `/var/miencraft/libraries`\n\n## Layers\n\nThe container makes extensive use of layering:\n\n- Glibc from Debian.\n- a JRE\n- Your mod loader of choice\n- Each download from the mrpack file, one layer per download \n- Overrides from the mrpack file\n- Server overrides from the mrpack file\n- Permissions changes\n\n## Development\n\nThis project is written in pure [Rust](https://www.rust-lang.org/), and uses [Cargo](https://doc.rust-lang.org/cargo/) for all building.\n[Tokio](https://tokio.rs/) is used as the async runtime of choice. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameslaverack%2Fmrpack-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjameslaverack%2Fmrpack-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjameslaverack%2Fmrpack-container/lists"}