Build a new container:
docker build -t mycontainer .
Start the container
docker run mycontainer
Start the container detached (returning containerID)
docker run --detach mycontainer
Stop containerdocker stop mycontainer
Restart container (silent)
docker start mycontainer
Restart container (with console attached)
docker attach mycontainer
Keep data changes made on containerdocker commit mycontainer
Execute command on running container
docker exec -it mycontainerID bash
remove all containers:
docker rm $(docker ps -a -q)
To show only running containers use the given command:
Commit a change made in a running container:
docker commit CONTAINER_ID myContainer
To show all containers use the given command:
With environment vars: docker run --env-file ./env.list mycontainer