Docker Flashcards
command to build a docker image
docker build -t friendlyhello (image name)
run docker image and map port 80 from within the container to 4000
docker run -p 4000:80 friendlyhello
docker run the image in background )giving back the command prompt) plus map the port 80 from within the container to port 4000 outside.
docker run -p -d 4000:80 frendlyhello
list all running docker containers
docker container ls (old style docker ps)
list all containers even those not running
docker container ls -a
gracefully stop a container
docker stop container ID
forcefully shutdown a container
docker container kill
remove a specified container from this machine
docker container rm
list all images on this machine
docker image ls
remove a specified image from this machine
docker image rm
create a tag for an image docker
docker tag username/repository:tag
push the tagged image to the registry
docker push username/repository:tag
run the tagged image from the repo
docker run username/repository:tag
run a service consisting of multiple containers (tasks)
docker stack deploy -c docker-compose.yml appName
take down the app/ service
docker stack rm appName