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

docs(kubernetes): suggest the use of an init container to download mods which disallow project distribution

Open uhthomas opened this issue 1 year ago • 3 comments

Enhancement Type

Improve an existing feature

Describe the enhancement

Some mods disallow project distribution and have to be download manually. This can be tricky for containerised environments, especially for Kubernetes. It might be nice to document the use of an init container to download these assets automatically. See what I've done as an example here.

It might also be possible to write something quick for Docker compose too?

minecraft-cf-atm8-0 minecraft-server [mc-image-helper] 12:20:47.139 WARN  : The authors of the mod 'Fix Experience Bug (now with FABRIC and FORGE versions)' have disallowed project distribution. Manually download the file 'ExperienceBugFix-1.19-1.41.2.3.jar' from https://www.curseforge.com/minecraft/mc-mods/fix-experience-bug and supply the mod file separately.
minecraft-cf-atm8-0 minecraft-server [mc-image-helper] 12:20:45.911 WARN  : The authors of the mod 'More Overlays Updated' have disallowed project distribution. Manually download the file '[1.19.2] MoreOverlays 1.21.5' from https://www.curseforge.com/minecraft/mc-mods/more-overlays-updated and supply the mod file separately.
minecraft-cf-atm8-0 minecraft-server [mc-image-helper] 12:20:47.165 WARN  : The authors of the mod 'Hexerei' have disallowed project distribution. Manually download the file 'hexerei-0.3.0.jar' from https://www.curseforge.com/minecraft/mc-mods/hexerei and supply the mod file separately.

The linked example rendered as yaml:

initContainers:
  - name: download
    image: curlimages/curl:8.1.1
    args:
      - -C
      - '-'
      - -LOf
      - '{https://mediafilez.forgecdn.net/files/4178/188/ExperienceBugFix-1.19-1.41.2.3.jar,https://mediafilez.forgecdn.net/files/4322/445/moreoverlays-1.21.5-mc1.19.2.jar,https://mediafilez.forgecdn.net/files/4466/686/hexerei-0.3.0.jar}'
    workingDir: /downloads
    resources:
      limits:
        cpu: "1"
        memory: 1Gi
    volumeMounts:
      - name: downloads
        mountPath: /downloads
    imagePullPolicy: IfNotPresent
    securityContext:
      capabilities:
        drop:
          - ALL
      readOnlyRootFilesystem: true
      allowPrivilegeEscalation: false

uhthomas avatar Jun 02 '23 16:06 uhthomas