Docker-201 Flashcards
1
Q
Where can we find the Linux logs
A
/var/log
2
Q
How to build the DockerFile?
A
docker build -t image_name .
3
Q
How to run the Docker Image ?
A
docker run -p 8080:8080 -t -i -v srcfolder:dest_folder image_name
4
Q
How can I log in to the Image ?
A
docker exec -i -t image_id sh
5
Q
How can I run the image with sleep and -d , so that we will get the imageid
A
docker run -i -t -d -v src:dest image_name sleep 3600( -d is imp)
6
Q
How to see all containers?
A
docker ps
7
Q
How to stop Docker container
A
docker stop container_id
8
Q
How to remove docker container?
A
docker rm container_id –force
9
Q
How to create jar of image?
A
docker save busybox > busybox.tar