Skip to content

Instantly share code, notes, and snippets.

@violetbp
Created July 2, 2019 21:28
Show Gist options
  • Save violetbp/59a95c05abc612bbbbb633d3fb94b956 to your computer and use it in GitHub Desktop.
Save violetbp/59a95c05abc612bbbbb633d3fb94b956 to your computer and use it in GitHub Desktop.
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
#add to docker group
sudo groupadd docker
sudo usermod -aG docker $USER
#test
docker run hello-world
#start on boot
sudo systemctl enable docker
#store minecraft instances on the root of the drive
sudo mkdir /mc
sudo chgrp docker /mc
sudo chown docker /mc
# then these can be used
# docker run -d -it -v /mc/$NAME:/data -e EULA=TRUE -e "MOTD=MOTD" -e OPS=Comma,seperated -e ENABLE_COMMAND_BLOCK=true -e RCON_PASSWORD=optionalstring -p 25565:25565 -p 26675:25575 --name $NAME itzg/minecraft-server
# docker run -d -it -v /mc/$NAME:/data -e EULA=TRUE -e "MOTD=MOTD" -e OPS=Comma,seperated -p 25565:25565 --name $NAME itzg/minecraft-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment