docker pull image
Example:
docker pull mysql
docker ps
docker run --name nameWeGiveIt -d -it -p 80:80 image
-d: detached, as in server
-it: interactive+tty. Without this commands like docker inspect won‘t be able to display anything to you.
-p a:b Publish container port b as port a (or ip:port) on the host.
Examples:
docker run --name mysql -d -it -p 8888:80 mysql
And to see this configuration:
docker container port mysql
docker run -it --entrypoint sh image
This runs the interactive shell (sh) instead of the defined entrypoint.
docker exec -it containerIdOrName /bin/bash
...or if bash is not installed, the default shell:
docker exec -it containerIdOrName /bin/sh
docker cp foo.txt mycontainer:/foo.txt
docker cp mycontainer:/foo.txt foo.txt
docker inspect containerIdOrName
docker stop container
Container can be restarted, process is stopped, file system changes are preserved.
docker start containerIdOrName
Starts a previously stopped container.
docker start -ai containerIdOrName
Starts a previously stopped container and attach interactive.
docker rm containerIdOrName
Stops and removes a container, file system and all. Image is preserved.
docker pause containerIdOrName
Freezes all activity, only possible for Hyper-V containers.
docker inspect --format="{{.Id}}" containerIdOrName
Enter-PSSession containerIdOrName -RunAsAdministrator
docker build -t myRepo/myContainer:myVersion .