Last active
January 16, 2024 20:40
-
-
Save anupambhatnagar/07ebff374bc45e4b63eb42893cca7e87 to your computer and use it in GitHub Desktop.
Commonly used Docker commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Launch container and enter shell | |
docker run --rm -it <image_name> | |
# Create image from docker file | |
docker build -t <image_name:tag> -f /path/to/dockerfile . | |
# Create image from running container | |
docker commit <container_id> <account_name/image_name:tag> | |
# Push image to docker hub | |
docker push <image_name:tag> | |
# Run docker container with gpus | |
docker run -it --gpus all <image_name:tag> | |
# Stop a container | |
docker stop <CONTAINER_NAME> | |
# Delete an image | |
docker image rm <IMAGE:TAG> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment