-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker.html
192 lines (177 loc) · 8.42 KB
/
docker.html
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html>
<!-- Mirrored from apiary.com/docker by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 08 Oct 2022 09:01:59 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
<!--
* Author: apiary
-->
<meta charset="utf-8" />
<title>Docker Cheat Sheet | apiary.com</title>
<meta name="author" content="apiary" />
<meta name="description" content="apiary.com is a site collecting all the cheatsheets,all!" />
<meta name="keywords" content="development,cheatsheets," />
<link rel="stylesheet" href="static/css/default.css" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<script type="text/javascript" src="static/js/jquery.1.7.min.js"></script>
<script type="text/javascript" src="static/js/jquery.masonry.min.js"></script>
<script type="text/javascript" src="static/js/jquery.quicksearch.js"></script>
<script type="text/javascript" src="static/js/main.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-154846433-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-154846433-1');
</script>
<script data-ad-client="ca-pub-8625616776911349" async src="../pagead2.googlesyndication.com/pagead/js/f.txt"></script>
</head>
<body class="cheat-detail">
<div id="more-list-container">
<a href="javascript:void(0)">More »</a>
<ul id="nav-more-list">
<li><a href="git.html" title="Git Cheat Sheet">Git</a></li>
<li><a href="svn.html" title="SVN Cheat Sheet">SVN</a></li>
<li><a href="mysql.html" title="MySQL Cheat Sheet">MySQL</a></li>
<li><a href="regex.html" title="Regular Expression Cheat Sheet">Regex</a></li>
<li><a href="linux.html" title="Linux Command Line Cheat Sheet">Linux</a></li>
<li><a href="html.html" title="HTML Cheat Sheet">HTML</a></li>
<li><a href="html-dom.html" title="HTML-DOM Cheat Sheet">HTML-DOM</a></li>
<li><a href="mod_rewrite.html" title="mod_rewrite Cheat Sheet">mod_rewrite</a></li>
<li><a href="index.html#more" id="">Even More »</a></li>
</ul>
</div>
<div id="navbar">
<a id="logo" href="index.html">apiary.com</a>
<ul id="navlist" class="nav">
<li><a href="python.html" title="Python Cheat Sheet">Python</a></li>
<li><a href="jquery.html" title="jQuery Cheat Sheet">jQuery</a></li>
<li><a href="nodejs.html" title="NodeJS Cheat Sheet">NodeJS</a></li>
<li><a href="php.html" title="PHP Cheat Sheet">PHP</a></li>
<li><a href="java.html" title="Java Cheat Sheet">Java</a></li>
<li><a href="ruby.html" title="Ruby Cheat Sheet">Ruby</a></li>
<li><a href="javascript.html" title="Javascript Cheat Sheet">Javascript</a></li>
<li><a href="actionscript.html" title="ActionScript Cheat Sheet">ActionScript</a></li>
<li><a href="css.html" title="CSS Cheat Sheet">CSS</a></li>
<li><a href="express.html" title="Express Cheat Sheet">Express</a></li>
<li><a href="#more" id="nav-more">More »</a></li>
</ul>
</div>
<div style="position:fixed;right:105px;top:10px;z-index:200;">
<input type="" id="searchApi" placeholder="Search"/>
</div>
<div class="addthis_toolbox addthis_default_style" style="position:fixed;right:5px;top:17px;z-index:200;">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_sinaweibo"></a>
<a class="addthis_button_compact"></a>
</div>
<div class="loading">
Loading...
</div>
<div class="content content-400">
<div class="board board-326">
<h2 class="board-title">Resource</h2>
<div class="board-card">
<h3 class="board-card-title">Online</h3>
<ul>
<li><a href="https://www.docker.com/">Official wsebsite</a></li>
<li><a href="https://docs.docker.com/">Official documentation</a></li>
<li><a href="https://www.docker.com/">Central images hub</a></li>
</ul>
</div>
</div>
<div class="board board-326">
<h2 class="board-title">Daemon</h2>
<div class="board-card">
<h3 class="board-card-title">Lifecycle</h3>
<ul>
<li>service docker start</li>
<li>service docker stop</li>
</ul>
</div>
<div class="board-card">
<h3 class="board-card-title">Settings</h3>
<ul>
<li>/etc/default/docker</li>
<li class="tip">docker daemon settings file</li>
</ul>
</div>
</div>
<div class="board board-326">
<h2 class="board-title">Images</h2>
<div class="board-card">
<h3 class="board-card-title">Provisionning</h3>
<ul>
<li>docker pull image/name:label</li>
<li class="tip"> pull image image/name with label label from registry</li>
<li>docker pull registryhost:registryport/image/name:label</li>
<li class="tip"> pull image image/name with label label from given registry</li>
<li>docker push registryhost:registryport/image/name</li>
<li class="tip"> push image image/name to registryhost. image must have been tagged before</li>
</ul>
</div>
<div class="board-card">
<h3 class="board-card-title">Control</h3>
<ul>
<li>docker images</li>
<li class="tip"> list current available images</li>
<li>docker tag image/name registryhost:registryport/image/name</li>
<li class="tip">tag image/name to be pushed to new registry registryhost:registryport</li>
</ul>
</div>
<div class="board-card">
<h3 class="board-card-title">Import/Export</h3>
<ul>
<li>docker save -o image_archive.docker image/name</li>
<li class="tip">save image to image_archive.docker file</li>
<li>docker load image_archive.docker</li>
<li class="tip">loads the images from the archive</li>
</ul>
</div>
</div>
<div class="board board-326">
<h2 class="board-title">Containers</h2>
<div class="board-card">
<h3 class="board-card-title">Lifecycle</h3>
<ul>
<li>docker ps -a</li>
<li class="tip"> list all containers</li>
<li>docker rm name</li>
<li class="tip"> Remove container instance with given name or id</li>
<li>docker run --name ubuntu_bash -it ubuntu bash</li>
<li class="tip">runs bash sheel in an ubuntu instance nammed ubuntu_bash</li>
</ul>
<h3 class="board-card-title">Run options</h3>
<ul>
<li>-d</li>
<li class="tip">runs as a daemon</li>
<li>-p HOSTPORT:CONTAINERPORT</li>
<li class="tip">port routing between host port and container port</li>
<li>-v host/path:/container/mount/point</li>
<li class="tip">mount the host path to the container at the given mount point</li>
</ul>
</div>
</div>
<div class="board board-326">
<h2 class="board-title">Registry</h2>
<div class="board-card">
<h3 class="board-card-title">Local</h3>
<ul>
<li>docker run -d -p 5000:5000 --restart=always --name registry -v `pwd`/data:/var/lib/registry registry:2</li>
<li class="tip"><a href="https://docs.docker.com/registry/deploying/">source</a></li>
</ul>
</div>
</div>
</div>
<div id="ad" class="board hide">
</div>
<script type="text/javascript">
$('.content').append($('#ad'));
$('#ad').removeClass('hide');
</script>
<script type="text/javascript" src="../s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4fddf49419e0facd"></script>
</body>
<!-- Mirrored from apiary.com/docker by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 08 Oct 2022 09:01:59 GMT -->
</html>