We have summarized the minimum commands from terminal to container creation to dockerhub repository creation.
docker build -t --force-rm=true (Image name):(tag) .
--force-rm: Delete image if build fails
/ bin / bach can be changed to any execution command
docker run --runtime=nvidia --rm -v (Mount directory):(Directory name in the container)\\
--name (Container name) -it (Image name) /bin/bash
--runtime = nvidia: Runtime specification (probably changed as of 2020) --rm: Delete container at the end of execution -v: Share the host OS directory with the Docker container
docker commit (Container name) (Repository name):(tag)
docker login #You will be prompted for a username and password
docker push (Repository name):(tag)
docker images -a #Image list
docker rmi (Image ID) #Image deletion
docker ps -a #Container list
docker rm (Container ID) #Delete container
docker start -i (Container ID) #Container startup
-a: Show unused images and containers
Recommended Posts