-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker_commands
49 lines (25 loc) · 1.25 KB
/
docker_commands
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
sudo docker rmi $(sudo docker images -f "dangling=true" -q) (Remove all images with none name and tag)
sudo docker exec -it container_name /bin/bash (interactive docker)
sudo docker run -p system_port:docker_port -v systemdir:dockerdir imageName (-v for volume share)
sudo docker run -t -p system_port:docker_port -v systemdir:dockerdir imageName (print visible for -t)
sudo docker save imageName > imageName.tar
sudo docker load < imageName.tar
sudo docker build Dockerfile
sudo docker build . -f mydockerfilename.Dockerfile
sudo docker build -t imageName dirName(you want to build)
sudo docker images
sudo docker rmi imagename
sudo docker rm containerId
sudo docker run imageName
sudo docker run -it imageName bash (For interactive run)
sudo docker ps -a
sudo docker ps -l
sudo docker ps
sudo docker login (login to dockerHub for downloading images)
sudo docker pull imageName (Pull docker image from docker-hub)
sudo docker start containerId
sudo docker stop containerId
sudo docker stop $(sudo docker ps -aq) (Stop all docker container)
sudo docker rm $(sudo docker ps -aq) (remove all docker containers)
sudo docker rmi $(sudo docker ps -aq) (remove all docker images)
sudo docker-compose up -d (To run multiple docker containers with inter dependecy)