-
Notifications
You must be signed in to change notification settings - Fork 0
/
Docker Documentation
executable file
·123 lines (67 loc) · 2.78 KB
/
Docker Documentation
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Docker automates the repetitive tasks of setting up and configuring development environments so that developers can focus on what matters: building great software.
1. DOCKR INSTALLATION:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
For further info on installation follow the below link.
https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository
https://www.linode.com/docs/applications/containers/how-to-install-docker-and-deploy-a-lamp-stack
attach: sudo docker exec -it 2c35ff6fbbfd bash
List containers: sudo docker ps
https://hub.docker.com/r/linode/lamp/
https://stackoverflow.com/questions/24832972/docker-apt-get-update-fails
docker run -it -p 8080:80 ubuntu /bin/bash
echo "91.189.92.201 archive.ubuntu.com" >> /etc/hosts
cat /etc/hosts
apt-get update
--
run container
sudo docker run -p 8000:80 -t -i --dns 10.0.0.1 d41c71c0a7fc
sudo docker run -p 8005:80 -t -i myubuntu_14.04/lamp_mariadb:version
OR
sudo docker run -p 8005:80 -t -i d41c71c0a7fc
OR
docker run -it -d -p 52022:22 basickarl/docker-git-test
open running container
sudo docker exec -it 1ab6007b3836 bash
stop container
sudo docker stop 1a2d3cfdd8c4
commit container
sudo docker commit 1ab6007b3836 myubuntu_14.04/Lamp_mariadb:version1
list running container
sudo docker ps
list images
sudo docker images
search images
sudo docker search image_name
get image
sudo docker pull image_name_id
copy files to it
https://docs.docker.com/engine/reference/commandline/cp/#extended-description
sudo docker cp local_may31.tar.gz aba9c387174f:/knackforge/Public/
save and load images
https://linuxconfig.org/how-to-move-a-docker-image-to-another-system
docker save linuxconfig > linuxconfig.tar
docker load -i linuxconfig.tar
docker images
commands at startup
run docker container on reboot
docker run -d --restart=always -p 80:80 -i -t myuser/myproj /bin/bash
stop docker from restarting
docker update --restart=no my-container
To see the command used to run all containers
docker inspect -f "{{.Name}} {{.Config.Cmd}}" $(docker ps -a -q)
sudo docker commit --change='ENTRYPOINT ["/test.sh"]' 46f533d90063 autostart
docker run -p <host_port1>:<container_port1> -p <host_port2>:<container_port2>
docker run -it -p 8180:80 --restart=always dev_server21jun bash
docker run -it --restart=always -p 90:10051 -p 8002:80 -p 8983:8983 dev_server21jun bash