-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
320 lines (263 loc) · 13 KB
/
Copy pathindex.html
File metadata and controls
320 lines (263 loc) · 13 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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="wedojava" />
<title>Docker-Install-Log | 回风舞雪</title>
<meta name="description" content=" 参考:
Docker —— 从入门到实践 Docker官方-Linux " />
<meta name="keywords" content="Hugo, theme, zozo, huifeng" />
<link rel="shortcut icon" href="https://huifeng.me/images/favicon.ico" />
<link rel="stylesheet" type="text/css" media="screen" href="https://huifeng.me/css/normalize.css" />
<link rel="stylesheet" type="text/css" media="screen" href="https://cdn.jsdelivr.net/npm/animate.css@4.1.0/animate.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="https://huifeng.me/css/zozo.css" />
<link rel="stylesheet" type="text/css" media="screen" href="https://huifeng.me/css/search.css" />
<link rel="stylesheet" type="text/css" media="screen" href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" />
<link rel="stylesheet" type="text/css" media="screen" href="https://huifeng.me/css/highlight.css" />
</head>
<body>
<div class="main animate__animated animate__fadeInDown">
<div class="nav_container animated fadeInDown">
<div class="site_nav" id="site_nav">
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/posts/">Archive</a>
</li>
<li>
<a href="/tags/">Tags</a>
</li>
<li>
<a href="/about/">About</a>
</li>
</ul>
</div>
<div class="menu_icon">
<a id="menu_icon"><i class="ri-menu-line"></i></a>
</div>
</div>
<div class="header animated fadeInDown">
<div class="site_title_container">
<div class="site_title">
<h1>
<a href="https://huifeng.me">
<span>回风舞雪</span>
</a>
</h1>
</div>
<div class="description">
<p class="sub_title">Love My Love</p>
<div class="my_socials">
<a href="https://github.com/wedojava" title="github" target="_blank"><i class="ri-github-fill"></i></a>
<a href="https://weibo.com/wedojava" title="weibo" target="_blank"><i class="ri-weibo-fill"></i></a>
<a href="https://huifeng.me/index.xml" type="application/rss+xml" title="rss" target="_blank"><i
class="ri-rss-fill"></i></a>
</div>
</div>
</div>
</div>
<div class="content">
<div class="post_page">
<div class="post animate__animated animate__fadeInDown">
<div class="post_title post_detail_title">
<h2><a href='/posts/docker-install-log/'>Docker-Install-Log</a></h2>
<span class="date">2016.02.17</span>
</div>
<div class="post_content markdown"><blockquote>
<p>参考:</p>
</blockquote>
<ul>
<li><a href="https://www.gitbook.com/book/yeasy/docker_practice/details">Docker —— 从入门到实践</a></li>
<li><a href="https://docs.docker.com/linux/">Docker官方-Linux</a></li>
</ul>
<h1 id="for-windows-10failed">For Windows 10(failed)</h1>
<p>Reference:</p>
<p><a href="https://ubuntu.com/tutorials/tutorial-windows-ubuntu-hyperv-containers#4-download-the-ubuntu-container-image">Run Linux containers on Windows</a></p>
<h2 id="preparation">Preparation</h2>
<ol>
<li>hyper-v installed</li>
<li>docker installed (2.2.0 install cannot be success. recommend 2.1.0)</li>
</ol>
<h2 id="installmethod-1">Install(Method 1)</h2>
<p>while, I update docker.exe everything goes well.</p>
<ol>
<li>Download <code>docker.exe</code> from <a href="https://master.dockerproject.org/">Docker Master Binaries</a></li>
<li>Replace <code>C:\Program Files\Docker\Docker\resources\bin\docker.exe</code> you download from link above, and you can download any image from container manager: <a href="https://download.docker.com/kitematic/Kitematic-Windows.zip">Kitematic</a></li>
</ol>
<h2 id="installmethod-2-failed"><del>Install(method 2 failed)</del></h2>
<ol>
<li>
<p>Install docker desktop and download container manager: <a href="https://download.docker.com/kitematic/Kitematic-Windows.zip">Kitematic</a></p>
</li>
<li>
<p>download: <a href="https://partner-images.canonical.com/hyper-v/linux-containers/bionic/">Canonical Partner Images of Ubuntu for Linux containers on Microsoft Hyper-V</a> and unzip it.</p>
</li>
<li>
<p><code>mkdir C:\\lcow</code> used as scratch space for Docker while preparing the containers.</p>
</li>
<li>
<p><code>mkdir C:\\Program Files\\Linux Containers</code> where the Ubuntu container image will live.</p>
</li>
<li>
<p><strong>TIPS</strong>: never change the path: <code>C:\\Program Files\\Linux Containers</code>, it must be there.</p>
</li>
<li>
<p>Save script below to <code>.\set_perms.ps1</code>:</p>
<ol>
<li>
<div class="highlight"><pre class="chroma"><code class="language-powershell" data-lang="powershell"><span class="k">param</span><span class="p">(</span>
<span class="no">[string]</span> <span class="nv">$Root</span>
<span class="p">)</span>
<span class="c"># Give the virtual machines group full control</span>
<span class="nv">$acl</span> <span class="p">=</span> <span class="nb">Get-Acl</span> <span class="n">-Path</span> <span class="nv">$Root</span>
<span class="nv">$vmGroupRule</span> <span class="p">=</span> <span class="nb">new-object</span> <span class="n">System</span><span class="p">.</span><span class="n">Security</span><span class="p">.</span><span class="n">AccessControl</span><span class="p">.</span><span class="n">FileSystemAccessRule</span><span class="p">(</span><span class="s2">"NT VIRTUAL MACHINE\Virtual Machines"</span><span class="p">,</span> <span class="s2">"FullControl"</span><span class="p">,</span><span class="s2">"ContainerInherit,ObjectInherit"</span><span class="p">,</span> <span class="s2">"None"</span><span class="p">,</span> <span class="s2">"Allow"</span><span class="p">)</span>
<span class="nv">$acl</span><span class="p">.</span><span class="n">SetAccessRule</span><span class="p">(</span><span class="nv">$vmGroupRule</span><span class="p">)</span>
<span class="nb">Set-Acl</span> <span class="n">-AclObject</span> <span class="nv">$acl</span> <span class="n">-Path</span> <span class="nv">$Root</span>
</code></pre></div></li>
<li>
<p>You will need to give this folder extra permissions to allow Docker to use the images from it. Run the following Powershell script in an administrator Powershell window:</p>
</li>
<li>
<p><strong>TIP</strong> You may need to run <code>Set-ExecutionPolicy -Scope process unrestricted</code> to be allowed to run unsigned Powershell scripts.</p>
</li>
<li>
<div class="highlight"><pre class="chroma"><code class="language-cmd" data-lang="cmd">.\set_perms.ps1 <span class="s2">"C:\\Program Files\\Linux Containers"</span>
</code></pre></div></li>
</ol>
</li>
<li>
<p>Now, copy the Ubuntu container image <code>.vhdx</code> file that was decompressed at the previous step to <code>uvm.vhdx</code> under <code>C:\Program Files\Linux Containers</code>.</p>
</li>
</ol>
<h1 id="for-ubuntu">For Ubuntu</h1>
<h2 id="系统要求">系统要求</h2>
<p>use command blow:</p>
<pre><code>uname -a
</code></pre>
<p>or</p>
<pre><code>cat /proc/version
</code></pre>
<p>to get the kenrel version that is must biger than <code>3.10</code>.</p>
<p>Notice: Your Ubuntu version must biger than <code>12.04</code>.</p>
<p>First to update or have these packages which is blow:</p>
<ul>
<li>linux-image-generic-lts-trusty (必备)</li>
<li>linux-headers-generic-lts-trusty (必备)</li>
<li>xserver-xorg-lts-trusty (带图形界面时必备)</li>
<li>libgl1-mesa-glx-lts-trusty(带图形界面时必备)</li>
</ul>
<p>To use <code>aufs</code> storage,you’d better get the package:<code>linux-image-extra</code></p>
<pre><code>sudo apt-get install -y linux-image-extra-$(uname -r)
</code></pre>
<h2 id="添加镜像源">添加镜像源</h2>
<p>首先需要安装 apt-transport-https 包支持 https 协议的源。</p>
<pre><code>sudo apt-get install -y apt-transport-https
</code></pre>
<p>添加源的 gpg 密钥。</p>
<pre><code>sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
</code></pre>
<p>获取当前操作系统的代号。</p>
<pre><code>lsb_release -c
// echo info!
Codename: wily
</code></pre>
<p>12.04 (LTS) 代号为 precise,14.04 (LTS) 代号为 trusty,15.04 代号为 vivid,15.10 代号为 wily。</p>
<p>接下来就可以添加 Docker 的官方 apt 软件源了。通过下面命令创建 <code>/etc/apt/sources.list.d/docker.list</code> 文件,并写入源的地址内容。<strong>非 <code>wily</code> 版本的系统注意修改为自己对应的代号。</strong></p>
<pre><code>sudo cat <<EOF > /etc/apt/sources.list.d/docker.list
deb https://apt.dockerproject.org/repo ubuntu-wily main
EOF
</code></pre>
<p>如果执行报权限不足,请直接 <code>su</code> 用 <code>root</code> 用户执行。</p>
<p>添加成功后,更新 apt 软件包缓存。</p>
<pre><code>sudo apt-get update
</code></pre></div>
<div class="post_footer">
<div class="meta">
<div class="info">
<span class="field tags">
<i class="ri-stack-line"></i>
<a href="https://huifeng.me/tags/docker/">docker</a>
<a href="https://huifeng.me/tags/log/"> log</a>
<a href="https://huifeng.me/tags/ubuntu/"> ubuntu</a>
</span>
</div>
</div>
</div>
</div>
<div class="doc_comments">
<div class="comments_block_title">发表评论</div>
<div id="vcomments"></div>
</div>
<link rel="stylesheet" href="https://huifeng.me/css/comments.css" />
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<script type="text/javascript">
new Valine({
el: '#vcomments',
appId: 'yusajl3uDsnB888cn1ulQeKz-gzGzoHsz',
appKey: 'jYjHeNB1qVYREHe1zX4bRx7z',
placeholder: ' ',
visitor: 'true',
})
</script>
</div>
</div>
</div>
<a id="back_to_top" href="#" class="back_to_top"><i class="ri-arrow-up-s-line"></i></a>
<footer class="footer">
<div class="powered_by">
<a href="https://varkai.com">Designed by VarKai,</a>
<a href="http://www.gohugo.io/">Proudly published with Hugo</a>
</div>
<div class="footer_slogan">
<span>>_ Simple Is Correct.</span>
</div>
</footer>
<div id="fastSearch">
<input id="searchInput" tabindex="0">
<ul id="searchResults">
</ul>
</div>
<script src="/js/fuse.js"></script>
<script src="/js/fastsearch.js"></script>
<script src="https://huifeng.me/js/jquery-3.5.1.min.js"></script>
<link href="https://huifeng.me/css/fancybox.min.css" rel="stylesheet">
<script src="https://huifeng.me/js/fancybox.min.js"></script>
<script src="https://huifeng.me/js/zozo.js"></script>
<script type="text/javascript" async
src="https://cdn.bootcss.com/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$'], ['\[\[', '\]\]']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: {
equationNumbers: { autoNumber: "AMS" },
extensions: ["AMSmath.js", "AMSsymbols.js"]
}
}
});
MathJax.Hub.Queue(function () {
var all = MathJax.Hub.getAllJax(), i;
for (i = 0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
<style>
code.has-jax {
font: inherit;
font-size: 100%;
background: inherit;
border: inherit;
color: #515151;
}
</style>
</body>
</html>