-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathDockercommands
More file actions
93 lines (60 loc) · 1.76 KB
/
Dockercommands
File metadata and controls
93 lines (60 loc) · 1.76 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Docker -- Applications are today converted in to docker images
Dockerhub
DockerFile ------- DockerImage----------Container
Installation of Docker
--------------------
centos/linux ami
----------------
yum install docker
ubuntu
------
apt install docker.io
To check the docker version
-----------------------------
docker -v
To know more information about docker
------------------------------------
docker info
To know where docker is installed
------------------------------------
which docker
Go to DockerHub
-------------------
To pull/download the docker images locally
docker pull imagename
To view the downloaded docker images
------------------------------------
docker images
To run the docker image as a container
-------------------------------------
docker run -idt --name container-name image-name
To get inside a docker container
---------------------------------------
docker exec -it container-id bash
To view the Running Containers
------------------------------------------
docker ps
To view the Stopped + Running container
--------------------------------------------
docker ps -a
To stop a Running Docker container
----------------------------------------------
docker stop container-id
To start a Stopped Docker container
-----------------------------------------------
docker start container-id
To inspect a Docker container
----------------------------------------------
docker inspect container-d
To delete a container image, in case if it's not in use
------------------------------------------------------
docker rmi image-id
To remove a container
----------------------
docker rm container-id
vi Dockerfile
FROM ubuntu:latest
MAINTAINER becomedevops99@gmail.com
RUN apt update
RUN apt install git -y
RUN apt install nginx -y