frank4o4

Docker Reference Commands

Pull a image

docker pull alpine
docker pull itzg/minecraft-server

Delete a image

docker image rm IMAGE

List Images

docker images

Create a container

docker container create -i -t --name mycontainer alpine

Create and run

docker run -d -p 25565:25565 --name mc itzg/minecraft-server

Start Container

docker start <container name>

List Containers

docker container ls -a

See docker running

docker ps

Connect to a container

docker exec -it mycontainer bash

See Container Logs, maybe container wont start

docker logs minecraft_survival

Minecraft Container

docker run -itd --network ipvlan --ip 192.168.1.5 -e EULA=TRUE --name minecraft_survival itzg/minecraft-server:latest

Prune volumes

Volumes can be used by one or more containers, and take up space on the Docker host. Volumes are never removed automatically, because to do so could destroy data.

docker volume prune

Prune containers

docker container prune

Prune images

docker image prune