docker psShows you running containers (note the last columnname)docker logs <name>Shows you logs from the running containerdocker logs -f <name>Tails logs from a running containerdocker build -t <image_tag_name> .Builds the current dir as a docker imagedocker run <image>creates a container running the specified image--rmremove the container when it exits (good for dev)-euse to set environment variables in the conatiner - one assignment per flag--nameset a name for the running container-pforward a host ports traffic to the container port<host>:<container>, e.g.,5000:5000
docker run -it <image> <command>start a container running the specified image and then interactively run the command inside the container.- used for debugging
docker run -it <image> /bin/bashfor a shell on a non running container. i.e., it won't run theCMDspecified in theDockerfile
docker exec <container> <command>run a command in a running containerdocker stop -t1 <container>Stop a running containerdocker restart <containerrestarts the container with the previous arguments
Created
July 6, 2018 19:54
-
-
Save ktilcu/f6d0856e319d6768b9c6c06950a20ca1 to your computer and use it in GitHub Desktop.
Oft used docker cmds
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment