Use a full entrypoint instead of a runAsRoot script for minecraft #14
|
@ -1,6 +1,14 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
entrypoint = pkgs.writeScript "entrypoint.sh" ''
|
||||||
|
#!${pkgs.bash}/bin/bash
|
||||||
|
${pkgs.busybox}/bin/mkdir -p /var/lib/
|
||||||
|
${pkgs.gzip}/bin/gzip -dc ${./configs/minecraft.tar.gz} | ${pkgs.gnutar}/bin/tar -xf - -C /var/lib
|
||||||
|
echo 'eula=true' > /var/lib/minecraft/eula.txt
|
||||||
|
cp -f ${properties} /var/lib/minecraft
|
||||||
|
$@
|
||||||
|
'';
|
||||||
ops = pkgs.writeText "ops.json" (builtins.toJSON [
|
ops = pkgs.writeText "ops.json" (builtins.toJSON [
|
||||||
{
|
{
|
||||||
uuid = "140d177a-966f-41b8-a4c0-e305babd291b";
|
uuid = "140d177a-966f-41b8-a4c0-e305babd291b";
|
||||||
|
@ -72,13 +80,8 @@ in
|
||||||
imageFile = pkgs.dockerTools.buildImage {
|
imageFile = pkgs.dockerTools.buildImage {
|
||||||
name = "tlaternet/minecraft";
|
name = "tlaternet/minecraft";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
runAsRoot = ''
|
|
||||||
mkdir -p /var/lib/
|
|
||||||
${pkgs.gzip}/bin/gzip -dc ${./configs/minecraft.tar.gz} | ${pkgs.gnutar}/bin/tar -xf - -C /var/lib
|
|
||||||
echo 'eula=true' > /var/lib/minecraft/eula.txt
|
|
||||||
cp -f ${properties} /var/lib/minecraft
|
|
||||||
'';
|
|
||||||
config = {
|
config = {
|
||||||
|
Entrypoint = [ "${entrypoint}" ];
|
||||||
Cmd = [ "${pkgs.jre_headless}/bin/java"
|
Cmd = [ "${pkgs.jre_headless}/bin/java"
|
||||||
"-Xms2G"
|
"-Xms2G"
|
||||||
"-Xmx2G"
|
"-Xmx2G"
|
||||||
|
|
Loading…
Reference in a new issue