Skip to content

Instantly share code, notes, and snippets.

@jsturtevant
Created December 8, 2017 17:04
Show Gist options
  • Save jsturtevant/76cd95ac3bf53ab1afabefc1dcade569 to your computer and use it in GitHub Desktop.
Save jsturtevant/76cd95ac3bf53ab1afabefc1dcade569 to your computer and use it in GitHub Desktop.
Minecraft stateful windows 2016
FROM minecraft-server:nanoserver
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV EULA=TRUE `
ONLINE_MODE=FALSE `
SEED=-9363708386013540 `
VERSION=1.12.1 `
DIFFICULTY=peaceful `
GUI=FALSE `
CONSOLE=FALSE `
RCON_PASSWORD=cheesesteakjimmys
COPY customstart.ps1 C:\minecraft
WORKDIR c:\
ENTRYPOINT [ "powershell", "-File", "C:\\minecraft\\customstart.ps1" ]
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$worldtolink = $env:worldtolink
$storagename = $env:storagename
$passcode = $env:passcode
net use F: $worldtolink /u:AZURE\$storagename $passcode
cmd /c mklink /d "c:\data" "$worldtolink"
Start-Job -ScriptBlock {
while((Select-String -Pattern 'RCON running' -Path C:\minecraft\minecraft.out) -eq $null) { Write-Output "nothing"; Start-Sleep -Seconds 1 }
rcon-cli --host 127.0.0.1 --port 25575 --password cheesesteakjimmys ban b973ece7-93e7-477e-a69a-d22554953e89
} | Out-Null
powershell -File C:\minecraft\start.ps1 | Tee-Object C:\minecraft\minecraft.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment