Created
February 8, 2020 15:35
-
-
Save alexisrolland/2c22e6a1162f45da9fad9503e95940b0 to your computer and use it in GitHub Desktop.
Some useful examples of Docker commands which I'm tired to type over and over again...
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
# Connect to running container in interactive mode in a shell prompt | |
$ docker exec -it container_name sh | |
# Same as above with auto-remove and Docker network | |
$ docker run -it --rm --network network_name container_name sh | |
# Same as above with mounted volume (Windows Pro) | |
$ docker run -it --rm --network network_name -v "C:\host_path:/guest_path" container_name sh | |
# Same as above with mounted volume (Windows Home) | |
$ docker run -it --rm --network network_name -v "/c/host_path:/guest_path" container_name sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment