-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.html
209 lines (186 loc) · 6.35 KB
/
README.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Using Docker *Portable*</title>
<style>
/* From extension vscode.github */
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.vscode-dark img[src$=\#gh-light-mode-only],
.vscode-light img[src$=\#gh-dark-mode-only] {
display: none;
}
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css">
<link href="https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/markdown.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/highlight.css">
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif;
font-size: 14px;
line-height: 1.6;
}
</style>
<style>
.task-list-item {
list-style-type: none;
}
.task-list-item-checkbox {
margin-left: -20px;
vertical-align: middle;
pointer-events: none;
}
</style>
<style>
:root {
--color-note: #0969da;
--color-tip: #1a7f37;
--color-warning: #9a6700;
--color-severe: #bc4c00;
--color-caution: #d1242f;
--color-important: #8250df;
}
</style>
<style>
@media (prefers-color-scheme: dark) {
:root {
--color-note: #2f81f7;
--color-tip: #3fb950;
--color-warning: #d29922;
--color-severe: #db6d28;
--color-caution: #f85149;
--color-important: #a371f7;
}
}
</style>
<style>
.markdown-alert {
padding: 0.5rem 1rem;
margin-bottom: 16px;
color: inherit;
border-left: .25em solid #888;
}
.markdown-alert>:first-child {
margin-top: 0
}
.markdown-alert>:last-child {
margin-bottom: 0
}
.markdown-alert .markdown-alert-title {
display: flex;
font-weight: 500;
align-items: center;
line-height: 1
}
.markdown-alert .markdown-alert-title .octicon {
margin-right: 0.5rem;
display: inline-block;
overflow: visible !important;
vertical-align: text-bottom;
fill: currentColor;
}
.markdown-alert.markdown-alert-note {
border-left-color: var(--color-note);
}
.markdown-alert.markdown-alert-note .markdown-alert-title {
color: var(--color-note);
}
.markdown-alert.markdown-alert-important {
border-left-color: var(--color-important);
}
.markdown-alert.markdown-alert-important .markdown-alert-title {
color: var(--color-important);
}
.markdown-alert.markdown-alert-warning {
border-left-color: var(--color-warning);
}
.markdown-alert.markdown-alert-warning .markdown-alert-title {
color: var(--color-warning);
}
.markdown-alert.markdown-alert-tip {
border-left-color: var(--color-tip);
}
.markdown-alert.markdown-alert-tip .markdown-alert-title {
color: var(--color-tip);
}
.markdown-alert.markdown-alert-caution {
border-left-color: var(--color-caution);
}
.markdown-alert.markdown-alert-caution .markdown-alert-title {
color: var(--color-caution);
}
</style>
</head>
<body class="vscode-body vscode-light">
<h1 id="using-docker-portable">Using Docker <em>Portable</em></h1>
<h2 id="how-to-use">How to use?</h2>
<ol>
<li><code>docker</code> should be installed on machine.</li>
<li>edit docker config files (<code>/etc/docker/daemon.json</code>) in host machine and client machine:<pre><code class="language-json"><span class="hljs-punctuation">{</span>
<span class="hljs-attr">"experimental"</span><span class="hljs-punctuation">:</span> <span class="hljs-keyword">false</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">"insecure-registries"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"localhost:5000"</span><span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>
</code></pre>
</li>
<li>run in terminal:<pre><code class="language-bash">sudo <span class="hljs-built_in">chmod</span> u+x run.sh
./run.sh
</code></pre>
</li>
<li>go to <code>http://localhost:5000/v2/_catalog</code> to see available images.</li>
<li>how to pull image:<pre><code class="language-bash">sudo docker pull localhost:5000/<image-name>
</code></pre>
</li>
<li>it's done!</li>
</ol>
<blockquote>
<p>instead of <code>localhost</code> you should consider your ip in private network.
<em><strong>you should restart your docker after new configs</strong></em>.</p>
</blockquote>
<h2 id="docs">Docs</h2>
<ul>
<li>
<p>pull registry image from <code>Dockerub</code></p>
<pre><code class="language-bash">sudo docker pull registry
</code></pre>
</li>
<li>
<p>store pulled images on your machine in file for transfering</p>
<pre><code class="language-bash">docker save -o <save-location>/<file-name>.tar <image-name>
</code></pre>
</li>
<li>
<p>load image from file to machine</p>
<pre><code class="language-bash">docker load -i <image-file-path>.tar
</code></pre>
</li>
<li>
<p>run image to specific volume (for read and write)</p>
<pre><code class="language-bash">sudo docker run --<span class="hljs-built_in">rm</span> -v ./regvol:/var/lib/registry --name hooshan-registry -p 5000:5000 registry
</code></pre>
</li>
<li>
<p>add image to registry:</p>
<pre><code class="language-bash">sudo docker tag <image-name> <your-registry-address>/<image-name>
sudo docker push <your-registry-address>/<image-name>
</code></pre>
</li>
<li>
<p>remove all docker images:</p>
<pre><code class="language-bash">sudo docker rmi -f $(sudo docker images -aq)
</code></pre>
</li>
<li>
<p>remove all docker containers:</p>
<pre><code class="language-bash">sudo docker <span class="hljs-built_in">rm</span> -vf $(sudo docker ps -aq)
</code></pre>
<pre><code>sudo docker container prune
</code></pre>
</li>
</ul>
<script async src="https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js"></script>
</body>
</html>