Docker Flashcards
Building a container from dockerfile
docker build -t dockerfile:version
Show docker images
docker images
Run a container with networking
docker run -d -p 5000:5000 dockerfile
Stopping a container
docker stop
Create a container from an image.
docker create
Start an existing container.
docker start
Create a new container and start it.
docker run
List running containers.
docker ls
Get detailed information regarding the container.
docker inspect
Print run logs from the container’s execution.
docker logs
Stop the main process in the container abruptly.
docker kill
Delete a stopped container.
docker rm
List running containers
docker ps
List all past containers
docker ps -a
Removing a container
docker container rm
For pushing the container into docker hub
docker tag
Push Docker to hub
docker push
Removing the image locally
docker rmi -f
Getting the image using docker ID
docker pull
o Selects the base image used to start the build process.
o FROM
o Lets you select a name and email address for the image creator.
o MAINTAINER
o Creates image layers and executes commands within a container.
o RUN
o Executes a single command within a container. Only one can exist in a Dockerfile.
o CMD
o Sets the path where the command defined with CMD is to be executed.
o WORKDIR