-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDocker
More file actions
32 lines (31 loc) · 1.9 KB
/
Docker
File metadata and controls
32 lines (31 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
docker is container tool and container has images and applications.
docker hub, docker store and docker registry are three docker repositories
=================================================================================
DockerImage = it contains pre-written code
Docker hud, Docker store and Docker Repository are the three repositories in Docker
when we create docker .docker file will be created in user home directory(/root)
Detachedmode = we run docker in the background by the using command docker run -itd <imagename>
i=interactive, t=terminal, d=detached
docker ps ----> to display running containers
docker ps -a ----> to display all containers
docker attach <container id> ----> to start docker conatiner
cntrl+P+Q ----> to exit from container
docker login -----> to login into docker hub
docker search <image name> ---> to search images in docker hub
docker stop <container id> ----> to stop container
docker build -t <imagename> <filelocation> ----->to build docker image
docker tag <imageid> new imagename ---> to change docker image name
docker push <imagename> ----> to push docker image to the docker hub
docker run -itd -v /opt/prasad:/opt/prasad ubuntu ---> to move images from one container to another
docker inspect <container id> -----> to image details
Rootusermode = we run docker in the root only by using command docker run -it <imagename>
#docker images ------> to show docker images
#docker pull <imagename> -------> to pull docker image
#docker rm <containerid> ------> to remove conntainer
#docker rmi <imagename> ------> to remove image
#docker stop <container id> ------> to stop container
#FROM centos:latest ----> to create centos docker file
#MAINTAINER dhana <mailid> ------> maintainer of the file
#RUN apt-get update -y ------> the command that we want to run on the docker file
#docker build -t <nameof the file> path of the file
#docker tag <imageid> <newimagename> ----------> to rename docker image