docker build . -t <IMAGE_NAME>
OR
docker build . -t <IMAGE_NAME>:<VERSION>
If version is not specifed, latest
is set.
docker run -dt --name <CONTAINER_NAME> <IMAGE_NAME>:<VERSION>
docker exec -it <CONTAINER_NAME> /bin/bash
Note: use /bin/bash of /bin/sh, depend on the system
docker run -dt --name <CONTAINER_NAME> -v /volume/onto/host:/volume/into/container <IMAGE_NAME>
docker run -dt --name <CONTAINER_NAME> -p <HOST_PORT>:<CONTAINER_PORT> <IMAGE_NAME>
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
docker commit <OLD_CONTAINER> <NEW_IMAGE>
dokcer tag <IMAGE_NAME>:<VERSION> <REGISTRY_URL>/<NAMESPACE>/<IMAGE_NAME>:<VERSION>
example
dokcer tag nginx registry.server.com/mycompany/nginx
docker login -u <USER> -p <PASSWORD> <REGISTRY_URL>
example
docker login -u john -p 123456 registry.myserver.com