Compare commits
779 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc0f1223a0 | ||
|
|
dad6b9f022 | ||
|
|
e049bf2741 | ||
|
|
e59b50b43b | ||
|
|
8888612782 | ||
|
|
aa431b9a79 | ||
|
|
500325b7c8 | ||
|
|
cba52767b7 | ||
|
|
dc3a1c92d5 | ||
|
|
2ae8979c5c | ||
|
|
41633ecf24 | ||
|
|
48bcb9470b | ||
|
|
d47f565e83 | ||
|
|
b54b5b0a0f | ||
|
|
6c8e710c53 | ||
|
|
27f495466d | ||
|
|
cc8c36b1a3 | ||
|
|
f4e21a70b1 | ||
|
|
a2cdfdfded | ||
|
|
3b0f3c0cb2 | ||
|
|
37581d3016 | ||
|
|
49fd7a94da | ||
|
|
0a8887957e | ||
|
|
3356aa627f | ||
|
|
f20936e0af | ||
|
|
247bbcdc59 | ||
|
|
efdc3de9e0 | ||
|
|
42bb1bd1a1 | ||
|
|
c5935658bb | ||
|
|
bc6d6c85e3 | ||
|
|
ff7d5976a7 | ||
|
|
3a3939686c | ||
|
|
1a966e2979 | ||
|
|
a7d3a8291f | ||
|
|
6f9a5cca90 | ||
|
|
a5b762c2ce | ||
|
|
3cdde73798 | ||
|
|
e9213ea244 | ||
|
|
2b6e28d6a9 | ||
|
|
0699e96e36 | ||
|
|
2069a436e1 | ||
|
|
7b808e4d3d | ||
|
|
a071218f77 | ||
|
|
48718d6035 | ||
|
|
8666d2683f | ||
|
|
84c2183cc8 | ||
|
|
7ec38273bb | ||
|
|
6bca9e8dff | ||
|
|
6c6d2ac973 | ||
|
|
8747860b95 | ||
|
|
5a00a6b32f | ||
|
|
8a3be4634e | ||
|
|
c075122492 | ||
|
|
c9ebe3da2b | ||
|
|
941e01623c | ||
|
|
593a0c39ff | ||
|
|
823239010a | ||
|
|
d00b6e1911 | ||
|
|
b8dc1a7b16 | ||
|
|
710c1ec457 | ||
|
|
b9247c16df | ||
|
|
59af28af86 | ||
|
|
0baf0fec99 | ||
|
|
d14a0e0c4a | ||
|
|
e7c1782c51 | ||
|
|
7b02f90f09 | ||
|
|
4ed6156a03 | ||
|
|
3b959abf68 | ||
|
|
a0c7670738 | ||
|
|
8280d40922 | ||
|
|
1c1d81bd49 | ||
|
|
4f48fc2066 | ||
|
|
00ec580e74 | ||
|
|
3974a2de24 | ||
|
|
3442dab121 | ||
|
|
2e747fe2a5 | ||
|
|
df2537b721 | ||
|
|
bf04ac99a3 | ||
|
|
77c8ae525a | ||
|
|
f7dcffc7be | ||
|
|
a17f3f6b2f | ||
|
|
8576e16b61 | ||
|
|
4949de94c4 | ||
|
|
44e504c604 | ||
|
|
0370871867 | ||
|
|
d3c197ddfc | ||
|
|
8fc2003414 | ||
|
|
c446640591 | ||
|
|
6a97772e79 | ||
|
|
d4bbcc0cfb | ||
|
|
994f6ac101 | ||
|
|
fbf5a286ab | ||
|
|
81e68f241c | ||
|
|
aff886341f | ||
|
|
44530ff366 | ||
|
|
e2baa6401a | ||
|
|
560c23797a | ||
|
|
efee23eca7 | ||
|
|
234ac706a3 | ||
|
|
11e2bf1701 | ||
|
|
c8b73b20c6 | ||
|
|
2921a406d6 | ||
|
|
944cb0dfd1 | ||
|
|
2437dd0158 | ||
|
|
a7660df66e | ||
|
|
e2d5a2dff0 | ||
|
|
9899c7028e | ||
|
|
e1552503ac | ||
|
|
35f4ca76b6 | ||
|
|
e828a4888d | ||
|
|
af7663bd61 | ||
|
|
4d38aaad3b | ||
|
|
89f7f3cf98 | ||
|
|
7a45ac029e | ||
|
|
6d4702484d | ||
|
|
a50641d973 | ||
|
|
3b798d1e64 | ||
|
|
553ca77a07 | ||
|
|
e3c46e3b09 | ||
|
|
86657b8742 | ||
|
|
39b69945cc | ||
|
|
15ce0d8e04 | ||
|
|
8bd26974b7 | ||
|
|
38097d47eb | ||
|
|
cb5813d10a | ||
|
|
2cc1207dc3 | ||
|
|
6f12336f33 | ||
|
|
49841871aa | ||
|
|
1b306447ef | ||
|
|
dfa885f4f0 | ||
|
|
08dc228718 | ||
|
|
cabdcdb898 | ||
|
|
627b17d2f5 | ||
|
|
33bccf2ac4 | ||
|
|
9919fd1c43 | ||
|
|
b955c79fb9 | ||
|
|
1fdb8da844 | ||
|
|
a43bbd4f44 | ||
|
|
cbe21e28ec | ||
|
|
aa8adb4a36 | ||
|
|
7005ba3d88 | ||
|
|
276199aa37 | ||
|
|
ee656ff4bb | ||
|
|
c6ac96b64e | ||
|
|
2e70663bf9 | ||
|
|
80cb2445fc | ||
|
|
c3c182e674 | ||
|
|
fb66c7e5ee | ||
|
|
8f46e579f4 | ||
|
|
c6c0a6f1fe | ||
|
|
9f08baaa5c | ||
|
|
7bbc556e6e | ||
|
|
c6118d511d | ||
|
|
d242aaf10e | ||
|
|
113b5c2d20 | ||
|
|
b97e5e2a8b | ||
|
|
54a8025903 | ||
|
|
02d4c5704c | ||
|
|
e0791a61a2 | ||
|
|
5002488c24 | ||
|
|
20f19cbafd | ||
|
|
86d532630f | ||
|
|
fcd9f49e24 | ||
|
|
255292cc01 | ||
|
|
9b9ab2349a | ||
|
|
122df6f233 | ||
|
|
274cb33e89 | ||
|
|
ed816ba448 | ||
|
|
ca01158e1c | ||
|
|
60fb624a40 | ||
|
|
58c6540cdf | ||
|
|
79702eb956 | ||
|
|
fed0d4f65b | ||
|
|
79801a2389 | ||
|
|
c753f3b509 | ||
|
|
9187715bf0 | ||
|
|
85f22aff35 | ||
|
|
4c2acb419b | ||
|
|
5cfe40a504 | ||
|
|
107b14d6bb | ||
|
|
717abe60e7 | ||
|
|
0ccdc3fcfe | ||
|
|
2c9acf141c | ||
|
|
4abfa103b6 | ||
|
|
0db00b9669 | ||
|
|
7594e11f23 | ||
|
|
d58af9ad64 | ||
|
|
3b59591f14 | ||
|
|
53e917bb08 | ||
|
|
9deb181814 | ||
|
|
37a9ed4b3b | ||
|
|
81ec7190d6 | ||
|
|
4667ffb091 | ||
|
|
3face791c6 | ||
|
|
3de028af98 | ||
|
|
24a24306ae | ||
|
|
dcb821d56b | ||
|
|
2d4841b764 | ||
|
|
d83d89f927 | ||
|
|
45e6dadac8 | ||
|
|
be6840b9c2 | ||
|
|
8a276c8595 | ||
|
|
8aa5ac4172 | ||
|
|
eb081e5dfa | ||
|
|
36b793408b | ||
|
|
6822561fd1 | ||
|
|
cb18e6f08f | ||
|
|
5f32d8f5ea | ||
|
|
c2f14bb2da | ||
|
|
dddfcf2832 | ||
|
|
c5c8b7d20a | ||
|
|
c726aa30df | ||
|
|
42317a359d | ||
|
|
8a43919e51 | ||
|
|
7753df7681 | ||
|
|
5603887437 | ||
|
|
d307ac54f6 | ||
|
|
8589701bea | ||
|
|
b2e0b720ac | ||
|
|
9d196a2022 | ||
|
|
1ea4934758 | ||
|
|
b2427b1742 | ||
|
|
b41d564c01 | ||
|
|
d9fe0cc0d4 | ||
|
|
19f8ec9654 | ||
|
|
38070099d8 | ||
|
|
c3bc7b124b | ||
|
|
c0fb7f3af0 | ||
|
|
4fa76da7f8 | ||
|
|
a614374641 | ||
|
|
8f92f3b114 | ||
|
|
7d7b4f2afc | ||
|
|
ba0b55101c | ||
|
|
95d063dbd1 | ||
|
|
047755b702 | ||
|
|
654737a396 | ||
|
|
8615cbf286 | ||
|
|
154a42bd69 | ||
|
|
e6291d57f9 | ||
|
|
e9c9b8391d | ||
|
|
3ab7f6dfb8 | ||
|
|
a3267d1b3a | ||
|
|
8dbaa7ea33 | ||
|
|
8939af4f97 | ||
|
|
6bcce7e562 | ||
|
|
6af58b6c4a | ||
|
|
0c594a5cc5 | ||
|
|
c44f4d78b1 | ||
|
|
9face881c7 | ||
|
|
f60f4dd975 | ||
|
|
3c40c84cde | ||
|
|
7b93ed069f | ||
|
|
3b508242ba | ||
|
|
8d240b84bb | ||
|
|
528267b4ba | ||
|
|
bf18493b9a | ||
|
|
17856d1067 | ||
|
|
e330bbdad2 | ||
|
|
31a0806e2b | ||
|
|
e0c41e4feb | ||
|
|
299013f4f7 | ||
|
|
79adc251a6 | ||
|
|
99172ecdad | ||
|
|
8e31d114f8 | ||
|
|
90b6d52969 | ||
|
|
240c26edf8 | ||
|
|
de1be5e574 | ||
|
|
3a09552f97 | ||
|
|
edd4464176 | ||
|
|
3aecfc8b54 | ||
|
|
4958b227d7 | ||
|
|
7c84589565 | ||
|
|
0d89e7120f | ||
|
|
94df5237a6 | ||
|
|
62bf5171e4 | ||
|
|
b7900844d2 | ||
|
|
52707276e6 | ||
|
|
0ac2b50df1 | ||
|
|
f2c04dff35 | ||
|
|
c8fed2d977 | ||
|
|
ce051cd1a1 | ||
|
|
12ab87c248 | ||
|
|
10a9cf5687 | ||
|
|
38cfeae83b | ||
|
|
555fee7d72 | ||
|
|
7b2ad5b30e | ||
|
|
fb85efc58d | ||
|
|
47eb770257 | ||
|
|
3e8abe7a38 | ||
|
|
9c71a03e56 | ||
|
|
1f59ebb225 | ||
|
|
221644a271 | ||
|
|
1ceb07e7f0 | ||
|
|
6dc994c19c | ||
|
|
5ff464fc96 | ||
|
|
28cf0432f3 | ||
|
|
6886790a18 | ||
|
|
71012e03d6 | ||
|
|
79bb7135db | ||
|
|
1aeafe53d8 | ||
|
|
7880173c63 | ||
|
|
55a2f02431 | ||
|
|
c798928369 | ||
|
|
9ab182913c | ||
|
|
99b8903808 | ||
|
|
57fc8a7b3d | ||
|
|
630de255d8 | ||
|
|
cc14818ffa | ||
|
|
e1db77a27a | ||
|
|
c6a74cdb98 | ||
|
|
c68386e0e2 | ||
|
|
99a7cd31b4 | ||
|
|
239c95771f | ||
|
|
a3d9d9382f | ||
|
|
d8e71510f7 | ||
|
|
cd776a1a96 | ||
|
|
afa90259dd | ||
|
|
9930d6c2ea | ||
|
|
d8f1e91471 | ||
|
|
6ec314e229 | ||
|
|
79dd874576 | ||
|
|
656f1445cb | ||
|
|
540c874ac0 | ||
|
|
84a0453a9b | ||
|
|
88607c404c | ||
|
|
5ed88ccd75 | ||
|
|
7cba69c5f7 | ||
|
|
f2a2e421b5 | ||
|
|
c4d6b80c18 | ||
|
|
4fc094c17f | ||
|
|
78335d324d | ||
|
|
134fc6aad9 | ||
|
|
d9a3b77753 | ||
|
|
d3d48f0e38 | ||
|
|
8bf728103b | ||
|
|
a9eb521865 | ||
|
|
e8a5cbb561 | ||
|
|
3a8c201fbe | ||
|
|
93f8b01d32 | ||
|
|
c55e82300c | ||
|
|
85d8a2d021 | ||
|
|
d372fe7eb6 | ||
|
|
a8e5a3069f | ||
|
|
bdb78e3331 | ||
|
|
75b1c683e0 | ||
|
|
b6baf62508 | ||
|
|
7ebb52d297 | ||
|
|
458b26712c | ||
|
|
b0e5d9894a | ||
|
|
50ed70f29b | ||
|
|
c251c3936d | ||
|
|
69f46f9664 | ||
|
|
0bbbad9add | ||
|
|
9b4b96d3a4 | ||
|
|
990f85cb5b | ||
|
|
584a3696a1 | ||
|
|
c5c10dd086 | ||
|
|
e531f6a36b | ||
|
|
9e3a4a3bbe | ||
|
|
486e9fb7d0 | ||
|
|
d1597500a3 | ||
|
|
4ae6580c4d | ||
|
|
7022c5ab4c | ||
|
|
31365bddf2 | ||
|
|
e2ebbd2f6e | ||
|
|
766f3015aa | ||
|
|
c9ee2a34e4 | ||
|
|
fd1eb89c1e | ||
|
|
4eabbf4661 | ||
|
|
f2386afe6c | ||
|
|
e65cf12625 | ||
|
|
addf6b936f | ||
|
|
4d4895435a | ||
|
|
c20ebd66e4 | ||
|
|
17bc13a877 | ||
|
|
04c031fc40 | ||
|
|
90bfc0d610 | ||
|
|
dce2e464da | ||
|
|
0077c223c8 | ||
|
|
47b202f7bc | ||
|
|
68c546add2 | ||
|
|
2fb8281127 | ||
|
|
fc416722a6 | ||
|
|
0d4c9eda69 | ||
|
|
304d6adc25 | ||
|
|
3dabcb0fa7 | ||
|
|
b3ce4ff613 | ||
|
|
c94a86b7f6 | ||
|
|
4b34085c5f | ||
|
|
5c7db73fd0 | ||
|
|
98c02be4cd | ||
|
|
3c27207c8e | ||
|
|
8c850ca22b | ||
|
|
ddbadcb64d | ||
|
|
29561e2395 | ||
|
|
0ba14de20a | ||
|
|
2cd1377229 | ||
|
|
edd5374247 | ||
|
|
ecf185ee61 | ||
|
|
176422becc | ||
|
|
d2512412d6 | ||
|
|
359e765322 | ||
|
|
cbc8f54ed7 | ||
|
|
99401dcc4f | ||
|
|
39bef7f604 | ||
|
|
457813a231 | ||
|
|
fef878d1f3 | ||
|
|
e866c2a651 | ||
|
|
e79a646b4e | ||
|
|
81e9416d13 | ||
|
|
40a14569ab | ||
|
|
3f754a806e | ||
|
|
5557170a95 | ||
|
|
e3beb61a5f | ||
|
|
9a42c63542 | ||
|
|
731dea9a16 | ||
|
|
4677bf077e | ||
|
|
15ae487adc | ||
|
|
dd248d7dc2 | ||
|
|
888f253ac5 | ||
|
|
ecb46c34ce | ||
|
|
7049b1ce99 | ||
|
|
80a07aee73 | ||
|
|
a7d8829eaa | ||
|
|
eb1573a1fe | ||
|
|
1a75b7d669 | ||
|
|
c0324f00c3 | ||
|
|
41a8e21fe8 | ||
|
|
ef3e10ccb4 | ||
|
|
c36a42be8c | ||
|
|
d3226aa818 | ||
|
|
7cbdf27d93 | ||
|
|
c3c3cf98cb | ||
|
|
813e601bc1 | ||
|
|
0ed5c2683c | ||
|
|
4139271563 | ||
|
|
48a3624644 | ||
|
|
fcc6535910 | ||
|
|
cb21e9b167 | ||
|
|
d1a640f383 | ||
|
|
f838297f05 | ||
|
|
1ea4c09c80 | ||
|
|
5ed1521c6a | ||
|
|
1d06af72da | ||
|
|
313bfc0b72 | ||
|
|
096350920c | ||
|
|
ff460c1f43 | ||
|
|
31fdca5373 | ||
|
|
4f42a0e730 | ||
|
|
833aa02d92 | ||
|
|
61be103f7f | ||
|
|
23d6736c12 | ||
|
|
d8632d8554 | ||
|
|
417900da5b | ||
|
|
6bbd85cc37 | ||
|
|
a3660ecede | ||
|
|
fe91c90324 | ||
|
|
a24a153289 | ||
|
|
baffd6a778 | ||
|
|
74289f0e6d | ||
|
|
a0135f2b71 | ||
|
|
695c8f2a49 | ||
|
|
426e6411d1 | ||
|
|
c9a27f1ad8 | ||
|
|
57dfd608d3 | ||
|
|
4fc19f3234 | ||
|
|
2232081465 | ||
|
|
ed2830ef50 | ||
|
|
beea9fae4b | ||
|
|
05b4a078a7 | ||
|
|
658a50cbcd | ||
|
|
b198267022 | ||
|
|
f41a7619b2 | ||
|
|
19c31d8150 | ||
|
|
8686fdbb7e | ||
|
|
583494274e | ||
|
|
83049d8a71 | ||
|
|
46fc5f3d39 | ||
|
|
7fccf1b2cd | ||
|
|
b470de0882 | ||
|
|
3e5e6bcd75 | ||
|
|
7c626d449f | ||
|
|
b4d8cc5230 | ||
|
|
9b6d6fe6f5 | ||
|
|
377a6939d1 | ||
|
|
2cc56f0b82 | ||
|
|
e42e1b9c51 | ||
|
|
c560b6e2fc | ||
|
|
9a805dffd4 | ||
|
|
cd660f8f93 | ||
|
|
0c27b25a83 | ||
|
|
24001f7b26 | ||
|
|
32042580ba | ||
|
|
36155d9ba0 | ||
|
|
de2f06a21c | ||
|
|
d8567a6171 | ||
|
|
fb75dd8e4d | ||
|
|
9686afcf6f | ||
|
|
c6245b2455 | ||
|
|
fd8d7ac7ed | ||
|
|
6e0aff86ed | ||
|
|
c751613c57 | ||
|
|
50ef788efd | ||
|
|
e7719de38f | ||
|
|
9c83eaa58b | ||
|
|
d6f1b3bde2 | ||
|
|
65d4e45c5e | ||
|
|
f1445d7fb2 | ||
|
|
82ecfd499a | ||
|
|
aa3b036630 | ||
|
|
8aaf0927d2 | ||
|
|
44346ba200 | ||
|
|
43f75a28b0 | ||
|
|
bd34ba8077 | ||
|
|
18a91f783e | ||
|
|
b0e680dfe8 | ||
|
|
212cd0289a | ||
|
|
6faf2b7b0e | ||
|
|
b0c572a9fe | ||
|
|
09d6c9f1a1 | ||
|
|
08534241df | ||
|
|
0a0d4a015e | ||
|
|
d7de30ef8a | ||
|
|
16ef5d63ba | ||
|
|
118b26f0a2 | ||
|
|
293cd25271 | ||
|
|
121c23e8f1 | ||
|
|
11d7179051 | ||
|
|
33b152c18f | ||
|
|
e553c0062b | ||
|
|
d032b463e5 | ||
|
|
c8f2f162ca | ||
|
|
34fc0e801a | ||
|
|
5e7ae549f3 | ||
|
|
a503c0708c | ||
|
|
e38f5be83c | ||
|
|
394b6622f9 | ||
|
|
aee43fea12 | ||
|
|
f4bb30b9f4 | ||
|
|
366346e2a9 | ||
|
|
ef65832291 | ||
|
|
a511565933 | ||
|
|
80a64ac0a4 | ||
|
|
af4ac70ceb | ||
|
|
bcd5fa4e58 | ||
|
|
de81226f53 | ||
|
|
25178fd616 | ||
|
|
5bc5219fa2 | ||
|
|
275644aa02 | ||
|
|
1ab64b2775 | ||
|
|
453e035885 | ||
|
|
16247bb8c3 | ||
|
|
2376e1ea18 | ||
|
|
5e6073f46e | ||
|
|
9f9151580d | ||
|
|
abce07cda6 | ||
|
|
f5747f6a5c | ||
|
|
b3d6b681cb | ||
|
|
d3f02b48cf | ||
|
|
2ae37ecfa5 | ||
|
|
f6e1be3cc0 | ||
|
|
b0bde1341c | ||
|
|
0b23cf591c | ||
|
|
93e2d43c4f | ||
|
|
6448a627f6 | ||
|
|
67fe62b449 | ||
|
|
4911fba3e0 | ||
|
|
8e3748cd8d | ||
|
|
54c0f43f19 | ||
|
|
3d66f42043 | ||
|
|
1962354f5f | ||
|
|
29c0385b12 | ||
|
|
a46012033f | ||
|
|
ecc493ac96 | ||
|
|
b1cf8d3dc1 | ||
|
|
63d52eba72 | ||
|
|
f2ede78953 | ||
|
|
2cfa980930 | ||
|
|
36ab0b9862 | ||
|
|
e8389a46b3 | ||
|
|
f2d6f998ab | ||
|
|
e537012881 | ||
|
|
590b0bea31 | ||
|
|
b0330ce1d8 | ||
|
|
bd7b7c18c3 | ||
|
|
5230300d30 | ||
|
|
fa3c55840c | ||
|
|
eb66a35128 | ||
|
|
3484bb3cf6 | ||
|
|
710956aed5 | ||
|
|
66b81709e7 | ||
|
|
66de644f33 | ||
|
|
5aec4fae19 | ||
|
|
5cd720a388 | ||
|
|
5291db9ad4 | ||
|
|
414a7cd087 | ||
|
|
5385a8b0dc | ||
|
|
4aec4f9d7a | ||
|
|
ff5eb9d96a | ||
|
|
34a0655774 | ||
|
|
72fbb7ed15 | ||
|
|
efb0afd0d9 | ||
|
|
e84a08c4f2 | ||
|
|
d816cd15ad | ||
|
|
48bf98a77b | ||
|
|
a37cf1b88c | ||
|
|
f3be1fe1f5 | ||
|
|
4a114902d6 | ||
|
|
3e0c0c6ef6 | ||
|
|
20d632465b | ||
|
|
f1b622ebfd | ||
|
|
28cfc39b9c | ||
|
|
fc5d514ec1 | ||
|
|
8889a6c8c3 | ||
|
|
45cdd756eb | ||
|
|
a119a30fa5 | ||
|
|
157923420f | ||
|
|
48badeb0a0 | ||
|
|
3f0b68c21d | ||
|
|
6c60ad459c | ||
|
|
f4e95e1215 | ||
|
|
aee6aa8fe6 | ||
|
|
3f41302794 | ||
|
|
6fd3097bd9 | ||
|
|
df94a6e1fb | ||
|
|
d8be8f15a9 | ||
|
|
c5ac987475 | ||
|
|
d8858e5e3d | ||
|
|
c7c5731104 | ||
|
|
65a1e69462 | ||
|
|
e2158ef4fd | ||
|
|
5b03c5d974 | ||
|
|
442f829ef5 | ||
|
|
c4028b0016 | ||
|
|
01ff5ca004 | ||
|
|
bdab0474c4 | ||
|
|
46be5458ef | ||
|
|
97d8e43b49 | ||
|
|
bf3100e68f | ||
|
|
57e97c6375 | ||
|
|
5c66e377f8 | ||
|
|
a63448d447 | ||
|
|
4fdbb1ee33 | ||
|
|
9fd3717645 | ||
|
|
8437b4fd1f | ||
|
|
3d9982357b | ||
|
|
b0626d8de8 | ||
|
|
e7fffbae3a | ||
|
|
8a68bf2108 | ||
|
|
7052c162e3 | ||
|
|
73161f3758 | ||
|
|
549d13b717 | ||
|
|
dcb2cfe246 | ||
|
|
e4e10ead0f | ||
|
|
4e70ce8578 | ||
|
|
8a2846741b | ||
|
|
18f3c52ba8 | ||
|
|
d894237ab5 | ||
|
|
a4de63b13f | ||
|
|
66e3bfcb6f | ||
|
|
efef4590b6 | ||
|
|
36b9f63707 | ||
|
|
0c6490c510 | ||
|
|
accd03a8e9 | ||
|
|
8e0137347b | ||
|
|
1fdc0dd63d | ||
|
|
7aab504ecb | ||
|
|
6be8a72e81 | ||
|
|
a0f18930f3 | ||
|
|
3c9695f9c1 | ||
|
|
4e6a59ebc5 | ||
|
|
26a6004ee5 | ||
|
|
6ce541c063 | ||
|
|
375512ec17 | ||
|
|
6076ac618a | ||
|
|
85c9b33621 | ||
|
|
dede6be4d3 | ||
|
|
3ed9e56dc3 | ||
|
|
507ae54044 | ||
|
|
1ef669b5e7 | ||
|
|
c0d6cc88d7 | ||
|
|
69d34f7607 | ||
|
|
904fb90f5b | ||
|
|
308f8c6f5a | ||
|
|
18bd64b147 | ||
|
|
7b68db9dc6 | ||
|
|
7c9ceaa4dc | ||
|
|
2ccf861503 | ||
|
|
1c4d30c374 | ||
|
|
1af242e154 | ||
|
|
9fa5ff18a7 | ||
|
|
2044998a27 | ||
|
|
a8e690e5f3 | ||
|
|
0cabecc05f | ||
|
|
51c1f16947 | ||
|
|
3e04648a41 | ||
|
|
280432204f | ||
|
|
6e5aeba187 | ||
|
|
1089796d49 | ||
|
|
7d4df6e369 | ||
|
|
45b0402226 | ||
|
|
bebc4f646c | ||
|
|
c9555eb0f5 | ||
|
|
33bfa4c9dc | ||
|
|
a6368a8091 | ||
|
|
55712f7bdf | ||
|
|
316b45f11a | ||
|
|
2fceed22ac | ||
|
|
5fa1b6024a | ||
|
|
c50cfe14e0 | ||
|
|
34fc4eee76 | ||
|
|
3bd6083e68 | ||
|
|
a6acd08bd0 | ||
|
|
6274d552d6 | ||
|
|
e2544bcb28 | ||
|
|
121f498011 | ||
|
|
7d9625ec25 | ||
|
|
3ca35d9638 | ||
|
|
c71cf6a731 | ||
|
|
062f008435 | ||
|
|
6158dda40e | ||
|
|
692db8b6a2 | ||
|
|
3291d4795f | ||
|
|
bfecf409ea | ||
|
|
eb32546e3c | ||
|
|
cd59aaf167 | ||
|
|
6066e9cc5a | ||
|
|
4d60922fa3 | ||
|
|
14fddb18be | ||
|
|
0dfe3ebcce | ||
|
|
99df02f626 | ||
|
|
0a4bd48a79 | ||
|
|
9956994b76 | ||
|
|
e564a7d4da | ||
|
|
950dadf54d | ||
|
|
a7d45c5a16 | ||
|
|
a435453b80 | ||
|
|
5ba3d7b007 | ||
|
|
bace19fdc0 | ||
|
|
76d8382136 | ||
|
|
17ecc5d33d | ||
|
|
8043983d75 | ||
|
|
28c1490fc6 | ||
|
|
f633c14de3 | ||
|
|
f026a1bee0 | ||
|
|
e0d2d0997f | ||
|
|
60ec1bf62c | ||
|
|
977221c5d1 | ||
|
|
72144f1032 | ||
|
|
62aa90a3bf | ||
|
|
94c15606b3 | ||
|
|
215a5dec0b | ||
|
|
2a6620036f | ||
|
|
c5a5656220 | ||
|
|
0e87b70fbf | ||
|
|
03b1d1ffc0 | ||
|
|
eb6683fbd7 | ||
|
|
345b0703a3 | ||
|
|
7f4e4145b0 | ||
|
|
c814568560 | ||
|
|
4cb1252a98 | ||
|
|
a2231978ab | ||
|
|
a3ca178621 | ||
|
|
0b607e92a2 | ||
|
|
29fcb84407 | ||
|
|
d457323780 | ||
|
|
f9c545dbfc | ||
|
|
ed893bea7e | ||
|
|
295b7cdb7f | ||
|
|
e4e3cca8d3 | ||
|
|
34a3c29865 | ||
|
|
b30d4a2328 | ||
|
|
5f59530d4c | ||
|
|
52a1755ce7 | ||
|
|
547ebe6053 | ||
|
|
fdeeaba0b0 | ||
|
|
8626d13738 | ||
|
|
36127abed9 | ||
|
|
8e976258b5 |
15
.drone.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build
|
||||
steps:
|
||||
- name: build
|
||||
image: yeasy/docker_practice:latest
|
||||
pull: if-not-exists # always never
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
commands:
|
||||
- docker-entrypoint.sh build
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
29
.editorconfig
Normal file
@@ -0,0 +1,29 @@
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
|
||||
indent_style = space
|
||||
|
||||
indent_size = 2
|
||||
|
||||
end_of_line = lf
|
||||
|
||||
charset = utf-8
|
||||
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.py]
|
||||
|
||||
indent_size = 4
|
||||
|
||||
[Makefile]
|
||||
|
||||
indent_style = tab
|
||||
5
.gitattributes
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
* text=auto
|
||||
|
||||
*.sh text eol=lf
|
||||
|
||||
* linguist-language=go
|
||||
41
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
* [ ] Have u googled the problem? If no, pls do that first!
|
||||
|
||||
### Environment
|
||||
<!--请提供环境信息,包括操作系统版本等,保留你的操作系统,其他选项删除-->
|
||||
<!--Provides env info like OS version-->
|
||||
|
||||
* [x] Linux
|
||||
* [x] CentOS 7
|
||||
* [x] Fedora
|
||||
* [x] Ubuntu 16.04 +
|
||||
* [x] Debian 9 +
|
||||
* [x] macOS
|
||||
* [x] Windows 10
|
||||
* [x] Raspberry Pi (ARM)
|
||||
* [x] Others (Pls describe below)
|
||||
|
||||
### Docker Version
|
||||
<!--如果你的 Docker 版本低于 19.03 请尽可能升级到该版本,保留你的 Docker 版本,其他选项删除-->
|
||||
<!--if Docker version under 19.03, please upgrade Docker to 19.03-->
|
||||
|
||||
* [x] Edge (v19.03)
|
||||
* [x] Stable (v19.03)
|
||||
* [x] 1.13.0 or Before
|
||||
|
||||
### Problem Description
|
||||
<!--描述你的问题,请贴出操作步骤,终端报错截图或文字信息-->
|
||||
<!--describe problem with detailed steps and logs-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--提交问题之前请点击预览标签,符合要求之后再提交问题-->
|
||||
41
.github/ISSUE_TEMPLATE/Custom.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: Custom issue template
|
||||
about: Create a issue about Docker
|
||||
|
||||
---
|
||||
|
||||
* [ ] Have u googled the problem? If no, pls do that first!
|
||||
|
||||
### Environment
|
||||
<!--请提供环境信息,包括操作系统版本等,保留你的操作系统,其他选项删除-->
|
||||
<!--Provides env info like OS version-->
|
||||
|
||||
* [x] Linux
|
||||
* [x] CentOS 7
|
||||
* [x] Fedora
|
||||
* [x] Ubuntu 16.04 +
|
||||
* [x] Debian 9 +
|
||||
* [x] macOS
|
||||
* [x] Windows 10
|
||||
* [x] Raspberry Pi (ARM)
|
||||
* [x] Others (Pls describe below)
|
||||
|
||||
### Docker Version
|
||||
<!--如果你的 Docker 版本低于 19.03 请尽可能升级到该版本,保留你的 Docker 版本,其他选项删除-->
|
||||
<!--if Docker version under 19.03, please upgrade Docker to 19.03-->
|
||||
|
||||
* [x] Edge (v19.03)
|
||||
* [x] Stable (v19.03)
|
||||
* [x] 1.13.0 or Before
|
||||
|
||||
### Problem Description
|
||||
<!--描述你的问题,请贴出操作步骤,终端报错截图或文字信息-->
|
||||
<!--describe problem with detailed steps and logs-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--提交问题之前请点击预览标签,符合要求之后再提交问题-->
|
||||
5
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for docker_practice
|
||||
|
||||
---
|
||||
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<!--
|
||||
Thanks for your contribution.
|
||||
See [CONTRIBUTING](CONTRIBUTING.md) for contribution guidelines.
|
||||
-->
|
||||
|
||||
### Proposed changes (Mandatory)
|
||||
|
||||
<!--
|
||||
Tell us what you did and why:
|
||||
|
||||
One line short description
|
||||
|
||||
And details in other paragraphs.
|
||||
-->
|
||||
|
||||
### Fix issues (Optional)
|
||||
|
||||
<!--
|
||||
Tell us what issues you fixed, e.g., fix #123
|
||||
-->
|
||||
18
.github/workflows/ci.yaml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
name: CI
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build GitBook
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- name: Build
|
||||
uses: docker://yeasy/docker_practice
|
||||
with:
|
||||
args: build
|
||||
1
.gitignore
vendored
@@ -6,3 +6,4 @@ _book/
|
||||
*.swp
|
||||
*.edx
|
||||
.DS_Store
|
||||
node_modules/
|
||||
|
||||
53
.travis.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
language: bash
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
before_install:
|
||||
- openssl aes-256-cbc -K $encrypted_6cc8cff04075_key -iv $encrypted_6cc8cff04075_iv
|
||||
-in .travis/id_rsa.enc -out ~/.ssh/id_rsa -d
|
||||
- chmod 600 ~/.ssh/id_rsa
|
||||
- export TZ='Asia/Shanghai'
|
||||
- date
|
||||
- git config --global user.name "khs1994"
|
||||
- git config --global user.email "khs1994@khs1994.com"
|
||||
|
||||
script:
|
||||
- docker run -it --rm -v $PWD:/srv/gitbook-src yeasy/docker_practice build
|
||||
|
||||
after_success:
|
||||
- sudo chmod -R 777 _book
|
||||
|
||||
- echo "FROM nginx:alpine" >> Dockerfile
|
||||
- echo "COPY _book /usr/share/nginx/html" >> Dockerfile
|
||||
|
||||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||
|
||||
- docker build -t dockerpracticesig/docker_practice:us-en .
|
||||
- docker run -dit --rm -p 4000:80 dockerpracticesig/docker_practice:us-en
|
||||
|
||||
- sleep 5
|
||||
- curl 127.0.0.1:4000
|
||||
|
||||
- docker push dockerpracticesig/docker_practice:us-en
|
||||
|
||||
- cd _book
|
||||
- git init
|
||||
- git remote add origin "$DEPLOY_REPO"
|
||||
- git add .
|
||||
- COMMIT=`date "+%F %T"`
|
||||
- git commit -m "Travis CI Site updated $COMMIT"
|
||||
- git push -f origin master:"$DEPLOY_BRANCH"
|
||||
|
||||
env:
|
||||
global:
|
||||
- DEPLOY_BRANCH: master
|
||||
- DEPLOY_REPO: git@github.com:docker-practice/us-en.git
|
||||
|
||||
addons:
|
||||
ssh_known_hosts:
|
||||
- github.com
|
||||
|
||||
branches:
|
||||
only:
|
||||
- english
|
||||
26
.travis/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM node:alpine
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
WORKDIR /srv/gitbook
|
||||
|
||||
COPY book.json book.json
|
||||
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
|
||||
RUN apk add --no-cache \
|
||||
tzdata \
|
||||
&& npm install -g gitbook-cli \
|
||||
&& gitbook install \
|
||||
&& ln -s /usr/local/bin/docker-entrypoint.sh / \
|
||||
&& rm -rf /root/.npm /tmp/*
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
VOLUME /srv/gitbook-src
|
||||
|
||||
WORKDIR /srv/gitbook-src
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
CMD server
|
||||
37
.travis/book.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"title": "Docker -- 从入门到实践",
|
||||
"author": "yeasy",
|
||||
"language": "zh-hans",
|
||||
"links": {
|
||||
"sidebar": {
|
||||
"GitHub": "https://github.com/yeasy/docker_practice"
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"-livereload",
|
||||
"image-captions",
|
||||
"github",
|
||||
"page-treeview@2.9.8",
|
||||
"editlink"
|
||||
],
|
||||
"pluginsConfig": {
|
||||
"image-captions": {
|
||||
"attributes": {
|
||||
"width": "600"
|
||||
},
|
||||
"caption": "图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_"
|
||||
},
|
||||
"github": {
|
||||
"url": "https://github.com/yeasy/docker_practice"
|
||||
},
|
||||
"editlink": {
|
||||
"base": "https://github.com/yeasy/docker_practice/blob/master/",
|
||||
"label": "编辑本页"
|
||||
},
|
||||
"page-treeview": {
|
||||
"copyright": "Copyright © yeasy",
|
||||
"minHeaderCount": "2",
|
||||
"minHeaderDeep": "2"
|
||||
}
|
||||
}
|
||||
}
|
||||
43
.travis/conf.d/nginx.conf
Normal file
@@ -0,0 +1,43 @@
|
||||
user root;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
index index.html index.php;
|
||||
|
||||
server {
|
||||
|
||||
server_name localhost;
|
||||
|
||||
listen 4000;
|
||||
|
||||
root /srv/www/;
|
||||
|
||||
index index.html;
|
||||
|
||||
}
|
||||
}
|
||||
5
.travis/docker-compose.test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
sut:
|
||||
build: .
|
||||
volumes:
|
||||
- ../:/srv/gitbook-src
|
||||
command: build
|
||||
21
.travis/docker-entrypoint.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
START=`date "+%F %T"`
|
||||
|
||||
if [ $1 = "sh" ];then sh ; exit 0; fi
|
||||
|
||||
rm -rf node_modules _book
|
||||
|
||||
srcDir=$PWD
|
||||
|
||||
cp -a . /srv/gitbook
|
||||
|
||||
cd /srv/gitbook
|
||||
|
||||
main(){
|
||||
if [ "$1" = build ];then gitbook build && cp -a _book $srcDir && echo $START && date "+%F %T" && exit 0; fi
|
||||
exec gitbook serve
|
||||
exit 0
|
||||
}
|
||||
|
||||
main $1 $2 $3
|
||||
BIN
.travis/id_rsa.enc
Normal file
8
.travis/update.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# cd .travis
|
||||
# ./update.sh
|
||||
|
||||
if [ ! -f Dockerfile ];then exit 1; fi
|
||||
|
||||
cp -a ../book.json book.json
|
||||
120
CHANGELOG.md
Normal file
@@ -0,0 +1,120 @@
|
||||
## 主要修订记录
|
||||
|
||||
* 1.1.0 2019-12-31
|
||||
* 全面支持 v19.x 新版本
|
||||
* 增加 `BuildKit`
|
||||
* 增加 `docker manifest` 命令使用说明
|
||||
* 移除 `Ubuntu 14.04` `Debian 8` `Debian 7`
|
||||
|
||||
* 1.0.0: 2018-12-31
|
||||
* 全面支持 v18.x 新版本
|
||||
* 添加如何调试 Docker
|
||||
* 错误修正
|
||||
|
||||
* 0.9.0: 2017-12-31
|
||||
* 对 v1.13.x 旧版本的最后支持
|
||||
|
||||
* 0.9.0-rc2: 2017-12-10
|
||||
|
||||
* 增加 Docker 中文资源链接
|
||||
* 增加介绍基于 Docker 的 CI/CD 工具 `Drone`
|
||||
* 增加 `docker secret` 相关内容
|
||||
* 增加 `docker config` 相关内容
|
||||
* 增加 `LinuxKit` 相关内容
|
||||
|
||||
* 更新 `CoreOS` 章节
|
||||
* 更新 `etcd` 章节,基于 3.x 版本
|
||||
|
||||
* 删除 `Docker Compose` 中的 `links`指令
|
||||
|
||||
* 替换 `docker daemon` 命令为 `dockerd`
|
||||
* 替换 `docker ps` 命令为 `docker container ls`
|
||||
* 替换 `docker images` 命令为 `docker image ls`
|
||||
|
||||
* 修改 `安装 Docker` 一节中部分文字表述
|
||||
|
||||
* 移除历史遗留文件和错误的文件
|
||||
* 优化文字排版
|
||||
* 调整目录结构
|
||||
* 修复内容逻辑错误
|
||||
* 修复`404` 链接
|
||||
|
||||
* 0.9.0-rc1: 2017-11-29
|
||||
|
||||
* 根据最新版本(v17.09)修订内容
|
||||
|
||||
* 增加 `Dockerfile` 多阶段构建( `multistage builds` ) `Docker 17.05` 新增特性
|
||||
* 增加 `docker exec` 子命令介绍
|
||||
* 增加 `docker` 管理子命令 `container` `image` `network` `volume` 介绍
|
||||
* 增加 `树莓派单片电脑` 安装 Docker
|
||||
* 增加 Docker 存储驱动 `OverlayFS` 相关内容
|
||||
|
||||
* 更新 `Docker CE` `v17.x` 安装说明
|
||||
* 更新 `Docker 网络` 一节
|
||||
* 更新 `Docker Machine` 基于 0.13.0 版本
|
||||
* 更新 `Docker Compose` 基于 3 文件格式
|
||||
|
||||
* 删除 `Docker Swarm` 相关内容,替换为 `Swarm mode` `Docker 1.12.0` 新增特性
|
||||
* 删除 `docker run` `--link` 参数
|
||||
|
||||
* 精简 `Docker Registry` 一节
|
||||
|
||||
* 替换 `docker run` `-v` 参数为 `--mount`
|
||||
|
||||
* 修复 `404` 链接
|
||||
* 优化文字排版
|
||||
* 增加离线阅读功能
|
||||
|
||||
* 0.8.0: 2017-01-08
|
||||
|
||||
* 修正文字内容
|
||||
* 根据最新版本(1.12)修订安装使用
|
||||
* 补充附录章节
|
||||
|
||||
* 0.7.0: 2016-06-12
|
||||
|
||||
* 根据最新版本进行命令调整
|
||||
* 修正若干文字描述
|
||||
|
||||
* 0.6.0: 2015-12-24
|
||||
|
||||
* 补充 Machine 项目
|
||||
* 修正若干 bug
|
||||
|
||||
* 0.5.0: 2015-06-29
|
||||
|
||||
* 添加 Compose 项目
|
||||
* 添加 Machine 项目
|
||||
* 添加 Swarm 项目
|
||||
* 完善 Kubernetes 项目内容
|
||||
* 添加 Mesos 项目内容
|
||||
|
||||
* 0.4.0: 2015-05-08
|
||||
|
||||
* 添加 Etcd 项目
|
||||
* 添加 Fig 项目
|
||||
* 添加 CoreOS 项目
|
||||
* 添加 Kubernetes 项目
|
||||
|
||||
* 0.3.0: 2014-11-25
|
||||
|
||||
* 完成仓库章节
|
||||
* 重写安全章节
|
||||
* 修正底层实现章节的架构、命名空间、控制组、文件系统、容器格式等内容
|
||||
* 添加对常见仓库和镜像的介绍
|
||||
* 添加 Dockerfile 的介绍
|
||||
* 重新校订中英文混排格式
|
||||
* 修订文字表达
|
||||
* 发布繁体版本分支:zh-Hant
|
||||
|
||||
* 0.2.0: 2014-09-18
|
||||
|
||||
* 对照官方文档重写介绍、基本概念、安装、镜像、容器、仓库、数据管理、网络等章节
|
||||
* 添加底层实现章节
|
||||
* 添加命令查询和资源链接章节
|
||||
* 其它修正
|
||||
|
||||
* 0.1.0: 2014-09-05
|
||||
|
||||
* 添加基本内容
|
||||
* 修正错别字和表达不通顺的地方
|
||||
41
CONTRIBUTING.md
Normal file
@@ -0,0 +1,41 @@
|
||||
## 如何贡献项目
|
||||
|
||||
领取或创建新的 [Issue](https://github.com/yeasy/docker_practice/issues),如 [issue 235](https://github.com/yeasy/docker_practice/issues/235),添加自己为 `Assignee`。
|
||||
|
||||
在 [GitHub](https://github.com/yeasy/docker_practice/fork) 上 `fork` 到自己的仓库,如 `docker_user/docker_practice`,然后 `clone` 到本地,并设置用户信息。
|
||||
|
||||
```bash
|
||||
$ git clone git@github.com:docker_user/docker_practice.git
|
||||
|
||||
$ cd docker_practice
|
||||
```
|
||||
|
||||
修改代码后提交,并推送到自己的仓库,注意修改提交消息为对应 Issue 号和描述。
|
||||
|
||||
```bash
|
||||
# Update the content
|
||||
|
||||
$ git commit -a -s
|
||||
|
||||
# In commit msg dialog, add content like "Fix issue #235: describe ur change"
|
||||
|
||||
$ git push
|
||||
```
|
||||
|
||||
在 [GitHub](https://github.com/yeasy/docker_practice/pulls) 上提交 `Pull Request`,添加标签,并邀请维护者进行 `Review`。
|
||||
|
||||
定期使用项目仓库内容更新自己仓库内容。
|
||||
|
||||
```bash
|
||||
$ git remote add upstream https://github.com/yeasy/docker_practice
|
||||
|
||||
$ git fetch upstream
|
||||
|
||||
$ git rebase upstream/master
|
||||
|
||||
$ git push -f origin master
|
||||
```
|
||||
|
||||
## 排版规范
|
||||
|
||||
本开源书籍遵循 [中文排版指南](https://github.com/mzlogin/chinese-copywriting-guidelines) 规范。
|
||||
117
README.md
@@ -1,72 +1,69 @@
|
||||
Docker —— 从入门到实践
|
||||
===============
|
||||
# Docker — 从入门到实践(英文版)
|
||||
|
||||
v0.4
|
||||
[](https://github.com/yeasy/docker_practice) [](https://travis-ci.org/yeasy/docker_practice) [](https://github.com/yeasy/docker_practice/releases) [](https://github.com/docker/docker-ce) [](https://union-click.jd.com/jdc?e=&p=AyIGZRtYFAcXBFIZWR0yEgRQH1kXAhs3EUQDS10iXhBeGlcJDBkNXg9JHU4YDk5ER1xOGRNLGEEcVV8BXURFUFdfC0RVU1JRUy1OVxUBFwNXGVscMlVYLlAaXAV1Z1JHA0dWEHVXZTliY1QLWStaJQAWB10fXhwKEDdlG1wlUHzf462DsLMO0%2F%2BUjp2VIgZlG18RBBcCUBlbEAoTBWUcWxwySVI7HAhBBxEOBUgOFQYQUGUraxYyIjdVK1glQHxXUEhYEVEUUFQcC0IHGgRRSAgVARAPAhsLFgNCDl0ZWiUAEwZREg%3D%3D&t=W1dCFFlQCxxKQgFHREkdSVJKSQVJHFRXFk9FUlpGQUpLCVBaTFhbXQtWVmpSWRtYEAYQBVUS)
|
||||
|
||||
[Docker](docker.com) 是个伟大的项目,它彻底释放了虚拟化的威力,极大降低了云计算资源供应的成本,同时让应用的分发、测试、部署和分发都变得前所未有的高效和轻松!
|
||||
**v1.1.0**
|
||||
|
||||
本书既适用于具备基础 Linux 知识的 Docker 初学者,也希望可供理解原理和实现的高级用户参考。同时,书中给出的实践案例,可供在进行实际部署时借鉴。前六章为基础内容,供用户理解 Docker 的基本概念和操作;7 ~ 9 章介绍一些高级操作;第 10 章给出典型的应用场景和实践案例;11 ~ 13 章介绍关于 Docker 实现的相关技术。14 ~ 17章介绍相关的一些开源项目。
|
||||
| 语言 | 构建状态 | - |
|
||||
| :------------- | :------------- | :--- |
|
||||
| [zh-hans](https://github.com/yeasy/docker_practice) | [](https://travis-ci.org/yeasy/docker_practice)| [阅读](https://docker_practice.gitee.io/zh-cn) |
|
||||
| [us-en](https://github.com/yeasy/docker_practice/tree/english) | [](https://travis-ci.org/yeasy/docker_practice)| [阅读](https://docker_practice.gitee.io/us-en) |
|
||||
| [zh-hant](https://github.com/yeasy/docker_practice/tree/zh-Hant) | [](https://travis-ci.org/yeasy/docker_practice)| [阅读](https://docker_practice.gitee.io/zh_hant) |
|
||||
|
||||
在线阅读:[GitBook](https://www.gitbook.io/book/yeasy/docker_practice) 或 [DockerPool](http://dockerpool.com/static/books/docker_practice/index.html)。
|
||||
[Docker](https://www.docker.com) 是个划时代的开源项目,它彻底释放了计算虚拟化的威力,极大提高了应用的维护效率,降低了云计算应用开发的成本!使用 Docker,可以让应用的部署、测试和分发都变得前所未有的高效和轻松!
|
||||
|
||||
欢迎关注 DockerPool 社区微博 [@dockerpool](http://weibo.com/u/5345404432),或加入 DockerPool QQ 群(419042067),分享 Docker 资源,交流 Docker 技术。
|
||||
无论是应用开发者、运维人员、还是其他信息技术从业人员,都有必要认识和掌握 Docker,节约有限的生命。
|
||||
|
||||

|
||||
本书既适用于具备基础 Linux 知识的 Docker 初学者,也希望可供理解原理和实现的高级用户参考。同时,书中给出的实践案例,可供在进行实际部署时借鉴。前六章为基础内容,供用户理解 Docker 的基本概念和操作;7 ~ 9 章介绍包括数据管理、网络等高级操作;第 10 ~ 13 章介绍了容器生态中的几个核心项目;14、15 章讨论了关于 Docker 安全和实现技术等高级话题。后续章节则分别介绍包括 Etcd、CoreOS、Kubernetes、Mesos、容器云等相关热门开源项目。最后,还展示了使用容器技术的典型的应用场景和实践案例。
|
||||
|
||||
《[Docker 技术入门与实战](http://item.jd.com/11598400.html)》一书已经正式出版,包含大量第一手实战案例,欢迎大家阅读使用。
|
||||
* 在线阅读:[docker-practice.com](https://docker-practice.com/),[GitBook](https://yeasy.gitbooks.io/docker_practice/content/),[Github](https://github.com/yeasy/docker_practice/blob/master/SUMMARY.md),[GitBook 国内镜像](https://docker_practice.gitee.io/zh-cn),[GitBook 英文版国内镜像](https://docker_practice.gitee.io/us_en),[国内镜像](https://github.com/yeasy/docker_practice/wiki/%E9%A1%B9%E7%9B%AE%E5%9B%BD%E5%86%85%E9%95%9C%E5%83%8F)
|
||||
* 下载:[pdf](https://github.com/yeasy/docker_practice/wiki/%E4%B8%8B%E8%BD%BD),[epub](https://github.com/yeasy/docker_practice/wiki/%E4%B8%8B%E8%BD%BD)
|
||||
* [离线阅读 `$ docker run -it --rm -p 4000:80 dockerpracticesig/docker_practice`](https://github.com/yeasy/docker_practice/wiki/%E7%A6%BB%E7%BA%BF%E9%98%85%E8%AF%BB%E5%8A%9F%E8%83%BD%E8%AF%A6%E8%A7%A3)
|
||||
* [英文翻译](https://github.com/yeasy/docker_practice/issues/363)
|
||||
|
||||
* [China-Pub](http://product.china-pub.com/3770833)
|
||||
* [京东图书](http://item.jd.com/11598400.html)
|
||||
* [当当图书](http://product.dangdang.com/23620853.html)
|
||||
* [亚马逊图书](http://www.amazon.cn/%E5%9B%BE%E4%B9%A6/dp/B00R5MYI7C/ref=lh_ni_t?ie=UTF8&psc=1&smid=A1AJ19PSB66TGU)
|
||||
Docker 自身仍在快速发展中,生态环境也在蓬勃成长。建议初学者使用最新稳定版本的 Docker 进行学习实践。欢迎 [参与项目维护](CONTRIBUTING.md)。
|
||||
|
||||
## 主要版本历史
|
||||
* 0.4: 2015-05-08
|
||||
* 添加 Etcd 项目
|
||||
* 添加 Fig 项目
|
||||
* 添加 CoreOS 项目
|
||||
* 添加 Kuberetes 项目
|
||||
* 0.3: 2014-11-25
|
||||
* 完成仓库章节;
|
||||
* 重写安全章节;
|
||||
* 修正底层实现章节的架构、名字空间、控制组、文件系统、容器格式等内容;
|
||||
* 添加对常见仓库和镜像的介绍;
|
||||
* 添加 Dockerfile 的介绍;
|
||||
* 重新校订中英文混排格式。
|
||||
* 修订文字表达。
|
||||
* 发布繁体版本分支:zh-Hant。
|
||||
* 0.2: 2014-09-18
|
||||
* 对照官方文档重写介绍、基本概念、安装、镜像、容器、仓库、数据管理、网络等章节;
|
||||
* 添加底层实现章节;
|
||||
* 添加命令查询和资源链接章节;
|
||||
* 其它修正。
|
||||
* 0.1: 2014-09-05
|
||||
* 添加基本内容;
|
||||
* 修正错别字和表达不通顺的地方。
|
||||
* [修订记录](CHANGELOG.md)
|
||||
* [贡献者名单](https://github.com/yeasy/docker_practice/graphs/contributors)
|
||||
|
||||
## 微信小程序
|
||||
|
||||
本书源码在 Github 上维护,欢迎参与:[https://github.com/yeasy/docker_practice](https://github.com/yeasy/docker_practice)。贡献者 [名单](https://github.com/yeasy/docker_practice/graphs/contributors)。
|
||||
<p align="center">
|
||||
<img width="200" src="https://user-images.githubusercontent.com/16733187/49682252-3ac4c500-faec-11e8-86ab-eafe0139be6b.jpg">
|
||||
</p>
|
||||
|
||||
## 参加步骤
|
||||
* 在 GitHub 上 `fork` 到自己的仓库,如 `docker_user/docker_practice`,然后 `clone` 到本地,并设置用户信息。
|
||||
```
|
||||
$ git clone git@github.com:docker_user/docker_practice.git
|
||||
$ cd docker_practice
|
||||
$ git config user.name "yourname"
|
||||
$ git config user.email "your email"
|
||||
```
|
||||
* 修改代码后提交,并推送到自己的仓库。
|
||||
```
|
||||
$ #do some change on the content
|
||||
$ git commit -am "Fix issue #1: change helo to hello"
|
||||
$ git push
|
||||
```
|
||||
* 在 GitHub 网站上提交 pull request。
|
||||
* 定期使用项目仓库内容更新自己仓库内容。
|
||||
```
|
||||
$ git remote add upstream https://github.com/yeasy/docker_practice
|
||||
$ git fetch upstream
|
||||
$ git checkout master
|
||||
$ git rebase upstream/master
|
||||
$ git push -f origin master
|
||||
```
|
||||
<p align="center"><strong>微信扫码 随时随地阅读~</strong></p>
|
||||
|
||||
## 技术交流
|
||||
|
||||
欢迎加入 Docker 技术交流 QQ 群,分享 Docker 资源,交流 Docker 技术。
|
||||
|
||||
* QQ 群 I (已满):341410255
|
||||
* QQ 群 II (已满):419042067
|
||||
* QQ 群 III (已满):210028779
|
||||
* QQ 群 IV (已满):483702734
|
||||
* QQ 群 V (已满):460598761
|
||||
* QQ 群 VI (已满):581983671
|
||||
* QQ 群 VII (已满):252403484
|
||||
* QQ 群 VIII(已满):544818750
|
||||
* QQ 群 IX (已满):571502246
|
||||
* QQ 群 X (可加):145983035
|
||||
|
||||
>如果有问题,请通过 [Issues](https://github.com/yeasy/docker_practice/issues/new/choose) 来提出。
|
||||
|
||||
## 进阶学习
|
||||
|
||||
[](https://union-click.jd.com/jdc?e=&p=AyIGZRtYFAcXBFIZWR0yEgRQH1kXAhs3EUQDS10iXhBeGlcJDBkNXg9JHU4YDk5ER1xOGRNLGEEcVV8BXURFUFdfC0RVU1JRUy1OVxUBFwNXGVscMlVYLlAaXAV1Z1JHA0dWEHVXZTliY1QLWStaJQAWB10fXhwKEDdlG1wlUHzf462DsLMO0%2F%2BUjp2VIgZlG18RBBcCUBlbEAoTBWUcWxwySVI7HAhBBxEOBUgOFQYQUGUraxYyIjdVK1glQHxXUEhYEVEUUFQcC0IHGgRRSAgVARAPAhsLFgNCDl0ZWiUAEwZREg%3D%3D&t=W1dCFFlQCxxKQgFHREkdSVJKSQVJHFRXFk9FUlpGQUpLCVBaTFhbXQtWVmpSWRtYEAYQBVUS)
|
||||
|
||||
《[Docker 技术入门与实战](https://union-click.jd.com/jdc?e=&p=AyIGZRtYFAcXBFIZWR0yEgRQH1kXAhs3EUQDS10iXhBeGlcJDBkNXg9JHU4YDk5ER1xOGRNLGEEcVV8BXURFUFdfC0RVU1JRUy1OVxUBFwNXGVscMlVYLlAaXAV1Z1JHA0dWEHVXZTliY1QLWStaJQAWB10fXhwKEDdlG1wlUHzf462DsLMO0%2F%2BUjp2VIgZlG18RBBcCUBlbEAoTBWUcWxwySVI7HAhBBxEOBUgOFQYQUGUraxYyIjdVK1glQHxXUEhYEVEUUFQcC0IHGgRRSAgVARAPAhsLFgNCDl0ZWiUAEwZREg%3D%3D&t=W1dCFFlQCxxKQgFHREkdSVJKSQVJHFRXFk9FUlpGQUpLCVBaTFhbXQtWVmpSWRtYEAYQBVUS)》第三版已经面世,介绍最新的容器技术栈,欢迎大家阅读使用并反馈建议。
|
||||
|
||||
* [京东图书](https://union-click.jd.com/jdc?e=&p=AyIGZRtYFAcXBFIZWR0yEgRQH1kXAhs3EUQDS10iXhBeGlcJDBkNXg9JHU4YDk5ER1xOGRNLGEEcVV8BXURFUFdfC0RVU1JRUy1OVxUBFwNXGVscMlVYLlAaXAV1Z1JHA0dWEHVXZTliY1QLWStaJQAWB10fXhwKEDdlG1wlUHzf462DsLMO0%2F%2BUjp2VIgZlG18RBBcCUBlbEAoTBWUcWxwySVI7HAhBBxEOBUgOFQYQUGUraxYyIjdVK1glQHxXUEhYEVEUUFQcC0IHGgRRSAgVARAPAhsLFgNCDl0ZWiUAEwZREg%3D%3D&t=W1dCFFlQCxxKQgFHREkdSVJKSQVJHFRXFk9FUlpGQUpLCVBaTFhbXQtWVmpSWRtYEAYQBVUS)
|
||||
* [China-Pub](http://product.china-pub.com/8052127)
|
||||
|
||||
## 鼓励项目
|
||||
|
||||
<p align="center">
|
||||
<img width="200" src="https://github.com/yeasy/docker_practice/raw/master/_images/donate.jpeg">
|
||||
</p>
|
||||
|
||||
<p align="center"><strong>欢迎鼓励项目一杯 coffee~</strong></p>
|
||||
|
||||
253
SUMMARY.md
@@ -1,100 +1,155 @@
|
||||
# Summary
|
||||
# [Docker — 从入门到实践(英文版)](https://github.com/yeasy/docker_practice/blob/english/SUMMARY.md)
|
||||
|
||||
* [前言](README.md)
|
||||
* [Docker 简介](introduction/README.md)
|
||||
* [什么是 Docker](introduction/what.md)
|
||||
* [为什么要用 Docker](introduction/why.md)
|
||||
* [基本概念](basic_concept/README.md)
|
||||
* [镜像](basic_concept/image.md)
|
||||
* [容器](basic_concept/container.md)
|
||||
* [仓库](basic_concept/repository.md)
|
||||
* [安装](install/README.md)
|
||||
* [Ubuntu](install/ubuntu.md)
|
||||
* [CentOS](install/centos.md)
|
||||
* [镜像](image/README.md)
|
||||
* [获取镜像](image/pull.md)
|
||||
* [列出](image/list.md)
|
||||
* [创建](image/create.md)
|
||||
* [存出和载入](image/save_load.md)
|
||||
* [移除](image/rmi.md)
|
||||
* [实现原理](image/internal.md)
|
||||
* [容器](container/README.md)
|
||||
* [启动](container/run.md)
|
||||
* [守护态运行](container/daemon.md)
|
||||
* [终止](container/stop.md)
|
||||
* [进入容器](container/enter.md)
|
||||
* [导出和导入](container/import_export.md)
|
||||
* [删除](container/rm.md)
|
||||
* [仓库](repository/README.md)
|
||||
* [Docker Hub](repository/dockerhub.md)
|
||||
* [私有仓库](repository/local_repo.md)
|
||||
* [配置文件](repository/config.md)
|
||||
* [数据管理](data_management/README.md)
|
||||
* [数据卷](data_management/volume.md)
|
||||
* [数据卷容器](data_management/container.md)
|
||||
* [备份、恢复、迁移数据卷](data_management/management.md)
|
||||
* [使用网络](network/README.md)
|
||||
* [外部访问容器](network/port_mapping.md)
|
||||
* [容器互联](network/linking.md)
|
||||
* [高级网络配置](advanced_network/README.md)
|
||||
* [快速配置指南](advanced_network/quick_guide.md)
|
||||
* [配置 DNS](advanced_network/dns.md)
|
||||
* [容器访问控制](advanced_network/access_control.md)
|
||||
* [端口映射实现](advanced_network/port_mapping.md)
|
||||
* [配置 docker0 网桥](advanced_network/docker0.md)
|
||||
* [自定义网桥](advanced_network/bridge.md)
|
||||
* [工具和示例](advanced_network/example.md)
|
||||
* [编辑网络配置文件](advanced_network/config_file.md)
|
||||
* [实例:创建一个点到点连接](advanced_network/ptp.md)
|
||||
* [实战案例](cases/README.md)
|
||||
* [使用 Supervisor 来管理进程](cases/supervisor.md)
|
||||
* [创建 tomcat/weblogic 集群](cases/tomcat.md)
|
||||
* [多台物理主机之间的容器互联](cases/container_connect.md)
|
||||
* [标准化开发测试和生产环境](cases/environment.md)
|
||||
* [安全](security/README.md)
|
||||
* [内核名字空间](security/kernel_ns.md)
|
||||
* [控制组](security/control_group.md)
|
||||
* [服务端防护](security/daemon_sec.md)
|
||||
* [内核能力机制](security/kernel_capability.md)
|
||||
* [其它安全特性](security/other_feature.md)
|
||||
* [总结](security/summary.md)
|
||||
* [Dockerfile](dockerfile/README.md)
|
||||
* [基本结构](dockerfile/basic_structure.md)
|
||||
* [指令](dockerfile/instructions.md)
|
||||
* [创建镜像](dockerfile/build_image.md)
|
||||
* [底层实现](underly/README.md)
|
||||
* [基本架构](underly/arch.md)
|
||||
* [名字空间](underly/namespace.md)
|
||||
* [控制组](underly/cgroups.md)
|
||||
* [联合文件系统](underly/ufs.md)
|
||||
* [容器格式](underly/container_format.md)
|
||||
* [网络](underly/network.md)
|
||||
* [Etcd 项目](etcd/README.md)
|
||||
* [简介](etcd/intro.md)
|
||||
* [安装](etcd/install.md)
|
||||
* [使用 etcdctl](etcd/etcdctl.md)
|
||||
* [Fig 项目](fig/README.md)
|
||||
* [简介](fig/intro.md)
|
||||
* [安装](fig/install.md)
|
||||
* [命令参考](fig/cli_ref.md)
|
||||
* [fig.yml参考](fig/yml_ref.md)
|
||||
* [环境变量参考](fig/env_ref.md)
|
||||
* [实战 Django](fig/django.md)
|
||||
* [实战 Rails](fig/rails.md)
|
||||
* [实战 wordpress](fig/wordpress.md)
|
||||
* [CoreOS 项目](coreos/README.md)
|
||||
* [Kubernetes 项目](kubernetes/README.md)
|
||||
* [简介](kubernetes/intro.md)
|
||||
* [快速上手](kubernetes/quickstart.md)
|
||||
* [架构设计](kubernetes/design.md)
|
||||
* [附录一:命令查询](appendix_command/README.md)
|
||||
* [附录二:常见仓库介绍](appendix_repo/README.md)
|
||||
* [Ubuntu](appendix_repo/ubuntu.md)
|
||||
* [CentOS](appendix_repo/centos.md)
|
||||
* [MySQL](appendix_repo/mysql.md)
|
||||
* [MongoDB](appendix_repo/mongodb.md)
|
||||
* [Redis](appendix_repo/redis.md)
|
||||
* [Nginx](appendix_repo/nginx.md)
|
||||
* [WordPress](appendix_repo/wordpress.md)
|
||||
* [Node.js](appendix_repo/nodejs.md)
|
||||
* [附录三:有用的资源](appendix_resources/README.md)
|
||||
* [README](README.md)
|
||||
* [CHANGELOG](CHANGELOG.md)
|
||||
* [CONTRIBUTING](CONTRIBUTING.md)
|
||||
* [Introduction](introduction/README.md)
|
||||
* [What is Docker](introduction/what.md)
|
||||
* [Why Docker](introduction/why.md)
|
||||
* [Basic concept](basic_concept/README.md)
|
||||
* [Image](basic_concept/image.md)
|
||||
* [Container](basic_concept/container.md)
|
||||
* [Repository](basic_concept/repository.md)
|
||||
* [Get Docker](install/README.md)
|
||||
* [Ubuntu](install/ubuntu.md)
|
||||
* [Debian](install/debian.md)
|
||||
* [Fedora](install/fedora.md)
|
||||
* [CentOS](install/centos.md)
|
||||
* [Raspberry Pi](install/raspberry-pi.md)
|
||||
* [macOS](install/mac.md)
|
||||
* [Windows PC](install/windows.md)
|
||||
* [Mirror](install/mirror.md)
|
||||
* [Image](image/README.md)
|
||||
* [pull](image/pull.md)
|
||||
* [list](image/list.md)
|
||||
* [Delete](image/rm.md)
|
||||
* [commit](image/commit.md)
|
||||
* [Dockerfile](image/build.md)
|
||||
* [Dockerfile reference](image/dockerfile/README.md)
|
||||
* [COPY](image/dockerfile/copy.md)
|
||||
* [ADD](image/dockerfile/add.md)
|
||||
* [CMD](image/dockerfile/cmd.md)
|
||||
* [ENTRYPOINT](image/dockerfile/entrypoint.md)
|
||||
* [ENV](image/dockerfile/env.md)
|
||||
* [ARG](image/dockerfile/arg.md)
|
||||
* [VOLUME](image/dockerfile/volume.md)
|
||||
* [EXPOSE](image/dockerfile/expose.md)
|
||||
* [WORKDIR](image/dockerfile/workdir.md)
|
||||
* [USER](image/dockerfile/user.md)
|
||||
* [HEALTHCHECK](image/dockerfile/healthcheck.md)
|
||||
* [ONBUILD](image/dockerfile/onbuild.md)
|
||||
* [References](image/dockerfile/references.md)
|
||||
* [Multistage builds](image/multistage-builds/README.md)
|
||||
* [Multistage builds Laravel](image/multistage-builds/laravel.md)
|
||||
* [manifest](image/manifest.md)
|
||||
* [BuildKit](image/buildkit.md)
|
||||
* [Other](image/other.md)
|
||||
* [Internal](image/internal.md)
|
||||
* [Container](container/README.md)
|
||||
* [run](container/run.md)
|
||||
* [Daemon](container/daemon.md)
|
||||
* [stop](container/stop.md)
|
||||
* [exec](container/attach_exec.md)
|
||||
* [Import and export](container/import_export.md)
|
||||
* [Delete](container/rm.md)
|
||||
* [Repository](repository/README.md)
|
||||
* [Docker Hub](repository/dockerhub.md)
|
||||
* [Docker Registry](repository/registry.md)
|
||||
* [Docker Registry TLS](repository/registry_auth.md)
|
||||
* [Nexus 3](repository/nexus3_registry.md)
|
||||
* [Data management](data_management/README.md)
|
||||
* [Volumes](data_management/volume.md)
|
||||
* [Bind mounts](data_management/bind-mounts.md)
|
||||
* [Network](network/README.md)
|
||||
* [Port mapping](network/port_mapping.md)
|
||||
* [Linking](network/linking.md)
|
||||
* [DNS](network/dns.md)
|
||||
* [Advanced network](advanced_network/README.md)
|
||||
* [Guide](advanced_network/quick_guide.md)
|
||||
* [Access control](advanced_network/access_control.md)
|
||||
* [Port mapping](advanced_network/port_mapping.md)
|
||||
* [docker0](advanced_network/docker0.md)
|
||||
* [Bridge](advanced_network/bridge.md)
|
||||
* [Example](advanced_network/example.md)
|
||||
* [Config](advanced_network/config_file.md)
|
||||
* [PTP](advanced_network/ptp.md)
|
||||
* [Docker Compose](compose/README.md)
|
||||
* [Introduction](compose/introduction.md)
|
||||
* [Install](compose/install.md)
|
||||
* [Usage](compose/usage.md)
|
||||
* [Commands](compose/commands.md)
|
||||
* [Compose file reference](compose/compose_file.md)
|
||||
* [Django](compose/django.md)
|
||||
* [Rails](compose/rails.md)
|
||||
* [WordPress](compose/wordpress.md)
|
||||
* [Docker Swarm](swarm/README.md)
|
||||
* [Swarm mode](swarm_mode/README.md)
|
||||
* [Overview](swarm_mode/overview.md)
|
||||
* [Create](swarm_mode/create.md)
|
||||
* [Deploy](swarm_mode/deploy.md)
|
||||
* [Stack](swarm_mode/stack.md)
|
||||
* [Secret](swarm_mode/secret.md)
|
||||
* [Config](swarm_mode/config.md)
|
||||
* [Rolling update](swarm_mode/rolling_update.md)
|
||||
* [Security](security/README.md)
|
||||
* [namespace](security/kernel_ns.md)
|
||||
* [cgroups](security/control_group.md)
|
||||
* [Daemon sec](security/daemon_sec.md)
|
||||
* [Kernel capability](security/kernel_capability.md)
|
||||
* [Other feature](security/other_feature.md)
|
||||
* [SUMMARY](security/summary.md)
|
||||
* [Underly](underly/README.md)
|
||||
* [Arch](underly/arch.md)
|
||||
* [namespace](underly/namespace.md)
|
||||
* [cgroups](underly/cgroups.md)
|
||||
* [ufs](underly/ufs.md)
|
||||
* [Container format](underly/container_format.md)
|
||||
* [Network](underly/network.md)
|
||||
* [Etcd](etcd/README.md)
|
||||
* [Introduction](etcd/intro.md)
|
||||
* [Install](etcd/install.md)
|
||||
* [Cluster](etcd/cluster.md)
|
||||
* [etcdctl](etcd/etcdctl.md)
|
||||
* [CoreOS](coreos/README.md)
|
||||
* [Introduction](coreos/intro.md)
|
||||
* [Tools](coreos/intro_tools.md)
|
||||
* [Kubernetes](kubernetes/README.md)
|
||||
* [Introduction](kubernetes/intro.md)
|
||||
* [Quick start](kubernetes/quickstart.md)
|
||||
* [Concepts](kubernetes/concepts.md)
|
||||
* [kubectl](kubernetes/kubectl.md)
|
||||
* [Design](kubernetes/design.md)
|
||||
* [Cloud](cloud/README.md)
|
||||
* [Introduction](cloud/intro.md)
|
||||
* [AWS](cloud/aws.md)
|
||||
* [Tencent Cloud](cloud/tencentCloud.md)
|
||||
* [Alibaba Cloud](cloud/alicloud.md)
|
||||
* [SUMMARY](cloud/summary.md)
|
||||
* [OS](cases/os/README.md)
|
||||
* [Busybox](cases/os/busybox.md)
|
||||
* [Alpine](cases/os/alpine.md)
|
||||
* [Debian Ubuntu](cases/os/debian.md)
|
||||
* [CentOS Fedora](cases/os/centos.md)
|
||||
* [SUMMARY](cases/os/summary.md)
|
||||
* [CI/CD](cases/ci/README.md)
|
||||
* [GitHub Actions](cases/ci/actions/README.md)
|
||||
* [Drone](cases/ci/drone/README.md)
|
||||
* [Install Drone](cases/ci/drone/install.md)
|
||||
* [Travis CI](cases/ci/travis/README.md)
|
||||
* [Docker Open Source](opensource/README.md)
|
||||
* [LinuxKit](opensource/linuxkit.md)
|
||||
* [Appendix](appendix/README.md)
|
||||
* [FAQ](appendix/faq/README.md)
|
||||
* [Sample Docker Image](appendix/repo/README.md)
|
||||
* [Ubuntu](appendix/repo/ubuntu.md)
|
||||
* [CentOS](appendix/repo/centos.md)
|
||||
* [Nginx](appendix/repo/nginx.md)
|
||||
* [PHP](appendix/repo/php.md)
|
||||
* [MySQL](appendix/repo/mysql.md)
|
||||
* [WordPress](appendix/repo/wordpress.md)
|
||||
* [MongoDB](appendix/repo/mongodb.md)
|
||||
* [Redis](appendix/repo/redis.md)
|
||||
* [Node.js](appendix/repo/nodejs.md)
|
||||
* [Docker commands](appendix/command/README.md)
|
||||
* [Docker debug](appendix/debug.md)
|
||||
* [Resources](appendix/resources.md)
|
||||
|
||||
2
_config.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
theme: jekyll-theme-slate
|
||||
include: [_images]
|
||||
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 29 KiB |
BIN
_images/cover.jpg
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
_images/cover.sketch
Normal file
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
BIN
_images/docker_primer2.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
_images/docker_primer3.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
_images/donate.jpeg
Normal file
|
After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 137 KiB |
@@ -1,45 +0,0 @@
|
||||
# Some useful commands to use docker.
|
||||
# Author: yeasy@github
|
||||
# Created:2014-09-25
|
||||
|
||||
alias docker-pid="sudo docker inspect --format '{{.State.Pid}}'"
|
||||
alias docker-ip="sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
|
||||
|
||||
#the implementation refs from https://github.com/jpetazzo/nsenter/blob/master/docker-enter
|
||||
function docker-enter() {
|
||||
if [ -e $(dirname "$0")/nsenter ]; then
|
||||
# with boot2docker, nsenter is not in the PATH but it is in the same folder
|
||||
NSENTER=$(dirname "$0")/nsenter
|
||||
else
|
||||
NSENTER=nsenter
|
||||
fi
|
||||
[ -z "$NSENTER" ] && echo "WARN Cannot find nsenter" && return
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: `basename "$0"` CONTAINER [COMMAND [ARG]...]"
|
||||
echo ""
|
||||
echo "Enters the Docker CONTAINER and executes the specified COMMAND."
|
||||
echo "If COMMAND is not specified, runs an interactive shell in CONTAINER."
|
||||
else
|
||||
PID=$(sudo docker inspect --format "{{.State.Pid}}" "$1")
|
||||
if [ -z "$PID" ]; then
|
||||
echo "WARN Cannot find the given container"
|
||||
return
|
||||
fi
|
||||
shift
|
||||
|
||||
OPTS="--target $PID --mount --uts --ipc --net --pid"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
# No command given.
|
||||
# Use su to clear all host environment variables except for TERM,
|
||||
# initialize the environment variables HOME, SHELL, USER, LOGNAME, PATH,
|
||||
# and start a login shell.
|
||||
#sudo $NSENTER "$OPTS" su - root
|
||||
sudo $NSENTER --target $PID --mount --uts --ipc --net --pid su - root
|
||||
else
|
||||
# Use env to clear all host environment variables.
|
||||
sudo $NSENTER --target $PID --mount --uts --ipc --net --pid env -i $@
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script will update all local images
|
||||
# See: https://github.com/yeasy/docker_practice/blob/master/_local/pull_all.sh
|
||||
# Usage: pull_all
|
||||
# Author: yeasy@github
|
||||
# Create: 2014-09-23
|
||||
|
||||
for image in `sudo docker images|grep -v "REPOSITORY"|grep -v "<none>"|awk '{print $1":"$2}'`
|
||||
do
|
||||
sudo docker pull $image
|
||||
done
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
# This script will upload all local images to a registry server ($registry is the default value).
|
||||
# This script requires the push_images, which can be found at https://github.com/yeasy/docker_practice/blob/master/_local/push_images.sh
|
||||
# Usage: push_all
|
||||
# Author: yeasy@github
|
||||
# Create: 2014-09-23
|
||||
|
||||
for image in `sudo docker images|grep -v "REPOSITORY"|grep -v "<none>"|awk '{print $1":"$2}'`
|
||||
do
|
||||
push_images $image
|
||||
done
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script will upload the given local images to a registry server ($registry is the default value).
|
||||
# See: https://github.com/yeasy/docker_practice/blob/master/_local/push_images.sh
|
||||
# Usage: push_images image1 [image2...]
|
||||
# Author: yeasy@github
|
||||
# Create: 2014-09-23
|
||||
|
||||
#The registry server address where you want push the images into
|
||||
registry=127.0.0.1:5000
|
||||
|
||||
### DO NOT MODIFY THE FOLLOWING PART, UNLESS YOU KNOW WHAT IT MEANS ###
|
||||
echo_r () {
|
||||
[ $# -ne 1 ] && return 0
|
||||
echo -e "\033[31m$1\033[0m"
|
||||
}
|
||||
echo_g () {
|
||||
[ $# -ne 1 ] && return 0
|
||||
echo -e "\033[32m$1\033[0m"
|
||||
}
|
||||
echo_y () {
|
||||
[ $# -ne 1 ] && return 0
|
||||
echo -e "\033[33m$1\033[0m"
|
||||
}
|
||||
echo_b () {
|
||||
[ $# -ne 1 ] && return 0
|
||||
echo -e "\033[34m$1\033[0m"
|
||||
}
|
||||
|
||||
usage() {
|
||||
sudo docker images
|
||||
echo "Usage: $0 registry1:tag1 [registry2:tag2...]"
|
||||
}
|
||||
|
||||
[ $# -lt 1 ] && usage && exit
|
||||
|
||||
echo_b "The registry server is $registry"
|
||||
|
||||
|
||||
for image in "$@"
|
||||
do
|
||||
echo_b "Uploading $image..."
|
||||
sudo docker tag $image $registry/$image
|
||||
sudo docker push $registry/$image
|
||||
sudo docker rmi $registry/$image
|
||||
echo_g "Done"
|
||||
done
|
||||
@@ -1,12 +1,15 @@
|
||||
# 高级网络配置
|
||||
|
||||
>注意:本章属于 `Docker` 高级配置,如果您是初学者,您可以暂时跳过本章节,直接学习 [Docker Compose](../compose) 一节。
|
||||
|
||||
本章将介绍 Docker 的一些高级网络配置和选项。
|
||||
|
||||
当 Docker 启动时,会自动在主机上创建一个 `docker0` 虚拟网桥,实际上是 Linux 的一个 bridge,可以理解为一个软件交换机。它会在挂载到它的网口之间进行转发。
|
||||
|
||||
同时,Docker 随机分配一个本地未占用的私有网段(在 [RFC1918](http://tools.ietf.org/html/rfc1918) 中定义)中的一个地址给 `docker0` 接口。比如典型的 `172.17.42.1`,掩码为 `255.255.0.0`。此后启动的容器内的网口也会自动分配一个同一网段(`172.17.0.0/16`)的地址。
|
||||
同时,Docker 随机分配一个本地未占用的私有网段(在 [RFC1918](https://tools.ietf.org/html/rfc1918) 中定义)中的一个地址给 `docker0` 接口。比如典型的 `172.17.42.1`,掩码为 `255.255.0.0`。此后启动的容器内的网口也会自动分配一个同一网段(`172.17.0.0/16`)的地址。
|
||||
|
||||
当创建一个 Docker 容器的时候,同时会创建了一对 `veth pair` 接口(当数据包发送到一个接口时,另外一个接口也可以收到相同的数据包)。这对接口一端在容器内,即 `eth0`;另一端在本地并被挂载到 `docker0` 网桥,名称以 `veth` 开头(例如 `vethAQI2QT`)。通过这种方式,主机可以跟容器通信,容器之间也可以相互通信。Docker 就创建了在主机和所有容器之间一个虚拟共享网络。
|
||||
|
||||

|
||||

|
||||
|
||||
接下来的部分将介绍在一些场景中,Docker 所有的网络定制配置。以及通过 Linux 命令来调整、补充、甚至替换 Docker 默认的网络配置。
|
||||
|
||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
@@ -4,12 +4,12 @@
|
||||
### 容器访问外部网络
|
||||
容器要想访问外部网络,需要本地系统的转发支持。在Linux 系统中,检查转发是否打开。
|
||||
|
||||
```
|
||||
```bash
|
||||
$sysctl net.ipv4.ip_forward
|
||||
net.ipv4.ip_forward = 1
|
||||
```
|
||||
如果为 0,说明没有开启转发,则需要手动打开。
|
||||
```
|
||||
```bash
|
||||
$sysctl -w net.ipv4.ip_forward=1
|
||||
```
|
||||
如果在启动 Docker 服务的时候设定 `--ip-forward=true`, Docker 就会自动设定系统的 `ip_forward` 参数为 1。
|
||||
@@ -20,9 +20,9 @@ $sysctl -w net.ipv4.ip_forward=1
|
||||
* 本地系统的防火墙软件 -- `iptables` 是否允许通过。
|
||||
|
||||
#### 访问所有端口
|
||||
当启动 Docker 服务时候,默认会添加一条转发策略到 iptables 的 FORWARD 链上。策略为通过(`ACCEPT`)还是禁止(`DROP`)取决于配置`--icc=true`(缺省值)还是 `--icc=false`。当然,如果手动指定 `--iptables=false` 则不会添加 `iptables` 规则。
|
||||
当启动 Docker 服务(即 dockerd)的时候,默认会添加一条转发策略到本地主机 iptables 的 FORWARD 链上。策略为通过(`ACCEPT`)还是禁止(`DROP`)取决于配置`--icc=true`(缺省值)还是 `--icc=false`。当然,如果手动指定 `--iptables=false` 则不会添加 `iptables` 规则。
|
||||
|
||||
可见,默认情况下,不同容器之间是允许网络互通的。如果为了安全考虑,可以在 `/etc/default/docker` 文件中配置 `DOCKER_OPTS=--icc=false` 来禁止它。
|
||||
可见,默认情况下,不同容器之间是允许网络互通的。如果为了安全考虑,可以在 `/etc/docker/daemon.json` 文件中配置 `{"icc": false}` 来禁止它。
|
||||
|
||||
#### 访问指定端口
|
||||
在通过 `-icc=false` 关闭网络访问后,还可以通过 `--link=CONTAINER_NAME:ALIAS` 选项来访问容器的开放端口。
|
||||
@@ -30,7 +30,7 @@ $sysctl -w net.ipv4.ip_forward=1
|
||||
例如,在启动 Docker 服务时,可以同时使用 `icc=false --iptables=true` 参数来关闭允许相互的网络访问,并让 Docker 可以修改系统中的 `iptables` 规则。
|
||||
|
||||
此时,系统中的 `iptables` 规则可能是类似
|
||||
```
|
||||
```bash
|
||||
$ sudo iptables -nL
|
||||
...
|
||||
Chain FORWARD (policy ACCEPT)
|
||||
@@ -39,10 +39,10 @@ DROP all -- 0.0.0.0/0 0.0.0.0/0
|
||||
...
|
||||
```
|
||||
|
||||
之后,启动容器(`docker run`)时使用 `--link=CONTAINER_NAME:ALIAS` 选项。Docker 会在 `iptable` 中为 两个容器分别添加一条 `ACCEPT` 规则,允许相互访问开放的端口(取决于 Dockerfile 中的 EXPOSE 行)。
|
||||
之后,启动容器(`docker run`)时使用 `--link=CONTAINER_NAME:ALIAS` 选项。Docker 会在 `iptable` 中为 两个容器分别添加一条 `ACCEPT` 规则,允许相互访问开放的端口(取决于 `Dockerfile` 中的 `EXPOSE` 指令)。
|
||||
|
||||
当添加了 `--link=CONTAINER_NAME:ALIAS` 选项后,添加了 `iptables` 规则。
|
||||
```
|
||||
```bash
|
||||
$ sudo iptables -nL
|
||||
...
|
||||
Chain FORWARD (policy ACCEPT)
|
||||
|
||||
@@ -1,34 +1,45 @@
|
||||
## 自定义网桥
|
||||
|
||||
除了默认的 `docker0` 网桥,用户也可以指定网桥来连接各个容器。
|
||||
|
||||
在启动 Docker 服务的时候,使用 `-b BRIDGE`或`--bridge=BRIDGE` 来指定使用的网桥。
|
||||
|
||||
如果服务已经运行,那需要先停止服务,并删除旧的网桥。
|
||||
```
|
||||
$ sudo service docker stop
|
||||
|
||||
```bash
|
||||
$ sudo systemctl stop docker
|
||||
$ sudo ip link set dev docker0 down
|
||||
$ sudo brctl delbr docker0
|
||||
```
|
||||
|
||||
然后创建一个网桥 `bridge0`。
|
||||
```
|
||||
|
||||
```bash
|
||||
$ sudo brctl addbr bridge0
|
||||
$ sudo ip addr add 192.168.5.1/24 dev bridge0
|
||||
$ sudo ip link set dev bridge0 up
|
||||
```
|
||||
|
||||
查看确认网桥创建并启动。
|
||||
```
|
||||
|
||||
```bash
|
||||
$ ip addr show bridge0
|
||||
4: bridge0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state UP group default
|
||||
link/ether 66:38:d0:0d:76:18 brd ff:ff:ff:ff:ff:ff
|
||||
inet 192.168.5.1/24 scope global bridge0
|
||||
valid_lft forever preferred_lft forever
|
||||
```
|
||||
配置 Docker 服务,默认桥接到创建的网桥上。
|
||||
```
|
||||
$ echo 'DOCKER_OPTS="-b=bridge0"' >> /etc/default/docker
|
||||
$ sudo service docker start
|
||||
|
||||
在 Docker 配置文件 `/etc/docker/daemon.json` 中添加如下内容,即可将 Docker 默认桥接到创建的网桥上。
|
||||
|
||||
```json
|
||||
{
|
||||
"bridge": "bridge0",
|
||||
}
|
||||
```
|
||||
|
||||
启动 Docker 服务。
|
||||
|
||||
新建一个容器,可以看到它已经桥接到了 `bridge0` 上。
|
||||
|
||||
可以继续用 `brctl show` 命令查看桥接的信息。另外,在容器中可以使用 `ip addr` 和 `ip route` 命令来查看 IP 地址配置和路由信息。
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## 编辑网络配置文件
|
||||
|
||||
Docker 1.2.0 开始支持在运行中的容器里编辑 `/etc/hosts`, `/etc/hostname` 和 `/etc/resolve.conf` 文件。
|
||||
Docker 1.2.0 开始支持在运行中的容器里编辑 `/etc/hosts`, `/etc/hostname` 和 `/etc/resolv.conf` 文件。
|
||||
|
||||
但是这些修改是临时的,只在运行的容器中保留,容器终止或重启后并不会被保存下来。也不会被 `docker commit` 提交。
|
||||
但是这些修改是临时的,只在运行的容器中保留,容器终止或重启后并不会被保存下来,也不会被 `docker commit` 提交。
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
## 配置 DNS
|
||||
Docker 没有为每个容器专门定制镜像,那么怎么自定义配置容器的主机名和 DNS 配置呢?
|
||||
秘诀就是它利用虚拟文件来挂载到来容器的 3 个相关配置文件。
|
||||
|
||||
在容器中使用 mount 命令可以看到挂载信息:
|
||||
```
|
||||
$ mount
|
||||
...
|
||||
/dev/disk/by-uuid/1fec...ebdf on /etc/hostname type ext4 ...
|
||||
/dev/disk/by-uuid/1fec...ebdf on /etc/hosts type ext4 ...
|
||||
tmpfs on /etc/resolv.conf type tmpfs ...
|
||||
...
|
||||
```
|
||||
这种机制可以让宿主主机 DNS 信息发生更新后,所有 Docker 容器的 dns 配置通过 `/etc/resolv.conf` 文件立刻得到更新。
|
||||
|
||||
如果用户想要手动指定容器的配置,可以利用下面的选项。
|
||||
|
||||
`-h HOSTNAME or --hostname=HOSTNAME`
|
||||
设定容器的主机名,它会被写到容器内的 `/etc/hostname` 和 `/etc/hosts`。但它在容器外部看不到,既不会在 `docker ps` 中显示,也不会在其他的容器的 `/etc/hosts` 看到。
|
||||
|
||||
`--link=CONTAINER_NAME:ALIAS`
|
||||
选项会在创建容器的时候,添加一个其他容器的主机名到 `/etc/hosts` 文件中,让新容器的进程可以使用主机名 ALIAS 就可以连接它。
|
||||
|
||||
`--dns=IP_ADDRESS`
|
||||
添加 DNS 服务器到容器的 `/etc/resolv.conf` 中,让容器用这个服务器来解析所有不在 `/etc/hosts` 中的主机名。
|
||||
|
||||
`--dns-search=DOMAIN`
|
||||
设定容器的搜索域,当设定搜索域为 `.example.com` 时,在搜索一个名为 host 的主机时,DNS 不仅搜索host,还会搜索 `host.example.com`。
|
||||
注意:如果没有上述最后 2 个选项,Docker 会默认用主机上的 `/etc/resolv.conf` 来配置容器。
|
||||
@@ -1,13 +1,17 @@
|
||||
## 配置 docker0 网桥
|
||||
|
||||
Docker 服务默认会创建一个 `docker0` 网桥(其上有一个 `docker0` 内部接口),它在内核层连通了其他的物理或虚拟网卡,这就将所有容器和本地主机都放到同一个物理网络。
|
||||
|
||||
Docker 默认指定了 `docker0` 接口 的 IP 地址和子网掩码,让主机和容器之间可以通过网桥相互通信,它还给出了 MTU(接口允许接收的最大传输单元),通常是 1500 Bytes,或宿主主机网络路由上支持的默认值。这些值都可以在服务启动的时候进行配置。
|
||||
* `--bip=CIDR` -- IP 地址加掩码格式,例如 192.168.1.5/24
|
||||
* `--mtu=BYTES` -- 覆盖默认的 Docker mtu 配置
|
||||
|
||||
* `--bip=CIDR` IP 地址加掩码格式,例如 192.168.1.5/24
|
||||
* `--mtu=BYTES` 覆盖默认的 Docker mtu 配置
|
||||
|
||||
也可以在配置文件中配置 DOCKER_OPTS,然后重启服务。
|
||||
|
||||
由于目前 Docker 网桥是 Linux 网桥,用户可以使用 `brctl show` 来查看网桥和端口连接信息。
|
||||
```
|
||||
|
||||
```bash
|
||||
$ sudo brctl show
|
||||
bridge name bridge id STP enabled interfaces
|
||||
docker0 8000.3a1d7362b4ee no veth65f9
|
||||
@@ -17,7 +21,8 @@ docker0 8000.3a1d7362b4ee no veth65f9
|
||||
|
||||
|
||||
每次创建一个新容器的时候,Docker 从可用的地址段中选择一个空闲的 IP 地址分配给容器的 eth0 端口。使用本地主机上 `docker0` 接口的 IP 作为所有容器的默认网关。
|
||||
```
|
||||
|
||||
```bash
|
||||
$ sudo docker run -i -t --rm base /bin/bash
|
||||
$ ip addr show eth0
|
||||
24: eth0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
|
||||
@@ -29,5 +34,4 @@ $ ip addr show eth0
|
||||
$ ip route
|
||||
default via 172.17.42.1 dev eth0
|
||||
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.3
|
||||
$ exit
|
||||
```
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
## 映射容器端口到宿主主机的实现
|
||||
|
||||
默认情况下,容器可以主动访问到外部网络的连接,但是外部网络无法访问到容器。
|
||||
|
||||
### 容器访问外部实现
|
||||
容器所有到外部网络的连接,源地址都会被NAT成本地系统的IP地址。这是使用 `iptables` 的源地址伪装操作实现的。
|
||||
|
||||
容器所有到外部网络的连接,源地址都会被 NAT 成本地系统的 IP 地址。这是使用 `iptables` 的源地址伪装操作实现的。
|
||||
|
||||
查看主机的 NAT 规则。
|
||||
```
|
||||
|
||||
```bash
|
||||
$ sudo iptables -t nat -nL
|
||||
...
|
||||
Chain POSTROUTING (policy ACCEPT)
|
||||
@@ -13,6 +16,7 @@ target prot opt source destination
|
||||
MASQUERADE all -- 172.17.0.0/16 !172.17.0.0/16
|
||||
...
|
||||
```
|
||||
|
||||
其中,上述规则将所有源地址在 `172.17.0.0/16` 网段,目标地址为其他网段(外部网络)的流量动态伪装为从系统网卡发出。MASQUERADE 跟传统 SNAT 的好处是它能动态从网卡获取地址。
|
||||
|
||||
### 外部访问容器实现
|
||||
@@ -22,7 +26,8 @@ MASQUERADE all -- 172.17.0.0/16 !172.17.0.0/16
|
||||
不管用那种办法,其实也是在本地的 `iptable` 的 nat 表中添加相应的规则。
|
||||
|
||||
使用 `-P` 时:
|
||||
```
|
||||
|
||||
```bash
|
||||
$ iptables -t nat -nL
|
||||
...
|
||||
Chain DOCKER (2 references)
|
||||
@@ -31,13 +36,22 @@ DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49153 to:1
|
||||
```
|
||||
|
||||
使用 `-p 80:80` 时:
|
||||
```
|
||||
|
||||
```bash
|
||||
$ iptables -t nat -nL
|
||||
Chain DOCKER (2 references)
|
||||
target prot opt source destination
|
||||
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.17.0.2:80
|
||||
```
|
||||
|
||||
注意:
|
||||
* 这里的规则映射了 0.0.0.0,意味着将接受主机来自所有接口的流量。用户可以通过 `-p IP:host_port:container_port` 或 `-p
|
||||
IP::port` 来指定允许访问容器的主机上的 IP、接口等,以制定更严格的规则。
|
||||
* 如果希望永久绑定到某个固定的 IP 地址,可以在 Docker 配置文件 `/etc/default/docker` 中指定 `DOCKER_OPTS="--ip=IP_ADDRESS"`,之后重启 Docker 服务即可生效。
|
||||
|
||||
* 这里的规则映射了 `0.0.0.0`,意味着将接受主机来自所有接口的流量。用户可以通过 `-p IP:host_port:container_port` 或 `-p IP::port` 来指定允许访问容器的主机上的 IP、接口等,以制定更严格的规则。
|
||||
|
||||
* 如果希望永久绑定到某个固定的 IP 地址,可以在 Docker 配置文件 `/etc/docker/daemon.json` 中添加如下内容。
|
||||
|
||||
```json
|
||||
{
|
||||
"ip": "0.0.0.0"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
解决办法很简单:创建一对 `peer` 接口,分别放到两个容器中,配置成点到点链路类型即可。
|
||||
|
||||
首先启动 2 个容器:
|
||||
```
|
||||
$ sudo docker run -i -t --rm --net=none base /bin/bash
|
||||
```bash
|
||||
$ docker run -i -t --rm --net=none base /bin/bash
|
||||
root@1f1f4c1f931a:/#
|
||||
$ sudo docker run -i -t --rm --net=none base /bin/bash
|
||||
$ docker run -i -t --rm --net=none base /bin/bash
|
||||
root@12e343489d2f:/#
|
||||
```
|
||||
|
||||
找到进程号,然后创建网络名字空间的跟踪文件。
|
||||
```
|
||||
$ sudo docker inspect -f '{{.State.Pid}}' 1f1f4c1f931a
|
||||
找到进程号,然后创建网络命名空间的跟踪文件。
|
||||
```bash
|
||||
$ docker inspect -f '{{.State.Pid}}' 1f1f4c1f931a
|
||||
2989
|
||||
$ sudo docker inspect -f '{{.State.Pid}}' 12e343489d2f
|
||||
$ docker inspect -f '{{.State.Pid}}' 12e343489d2f
|
||||
3004
|
||||
$ sudo mkdir -p /var/run/netns
|
||||
$ sudo ln -s /proc/2989/ns/net /var/run/netns/2989
|
||||
@@ -25,7 +25,7 @@ $ sudo ln -s /proc/3004/ns/net /var/run/netns/3004
|
||||
```
|
||||
|
||||
创建一对 `peer` 接口,然后配置路由
|
||||
```
|
||||
```bash
|
||||
$ sudo ip link add A type veth peer name B
|
||||
|
||||
$ sudo ip link set A netns 2989
|
||||
|
||||
@@ -3,21 +3,24 @@
|
||||
下面是一个跟 Docker 网络相关的命令列表。
|
||||
|
||||
其中有些命令选项只有在 Docker 服务启动的时候才能配置,而且不能马上生效。
|
||||
* `-b BRIDGE or --bridge=BRIDGE` --指定容器挂载的网桥
|
||||
* `--bip=CIDR` --定制 docker0 的掩码
|
||||
* `-H SOCKET... or --host=SOCKET...` --Docker 服务端接收命令的通道
|
||||
* `--icc=true|false` --是否支持容器之间进行通信
|
||||
* `--ip-forward=true|false` --请看下文容器之间的通信
|
||||
* `--iptables=true|false` --禁止 Docker 添加 iptables 规则
|
||||
* `--mtu=BYTES` --容器网络中的 MTU
|
||||
|
||||
下面2个命令选项既可以在启动服务时指定,也可以 Docker 容器启动(`docker run`)时候指定。在 Docker 服务启动的时候指定则会成为默认值,后面执行 `docker run` 时可以覆盖设置的默认值。
|
||||
* `--dns=IP_ADDRESS...` --使用指定的DNS服务器
|
||||
* `--dns-search=DOMAIN...` --指定DNS搜索域
|
||||
* `-b BRIDGE` 或 `--bridge=BRIDGE` 指定容器挂载的网桥
|
||||
* `--bip=CIDR` 定制 docker0 的掩码
|
||||
* `-H SOCKET...` 或 `--host=SOCKET...` Docker 服务端接收命令的通道
|
||||
* `--icc=true|false` 是否支持容器之间进行通信
|
||||
* `--ip-forward=true|false` 请看下文容器之间的通信
|
||||
* `--iptables=true|false` 是否允许 Docker 添加 iptables 规则
|
||||
* `--mtu=BYTES` 容器网络中的 MTU
|
||||
|
||||
下面2个命令选项既可以在启动服务时指定,也可以在启动容器时指定。在 Docker 服务启动的时候指定则会成为默认值,后面执行 `docker run` 时可以覆盖设置的默认值。
|
||||
|
||||
* `--dns=IP_ADDRESS...` 使用指定的DNS服务器
|
||||
* `--dns-search=DOMAIN...` 指定DNS搜索域
|
||||
|
||||
最后这些选项只有在 `docker run` 执行时使用,因为它是针对容器的特性内容。
|
||||
* `-h HOSTNAME or --hostname=HOSTNAME` --配置容器主机名
|
||||
* `--link=CONTAINER_NAME:ALIAS` --添加到另一个容器的连接
|
||||
* `--net=bridge|none|container:NAME_or_ID|host` --配置容器的桥接模式
|
||||
* `-p SPEC or --publish=SPEC` --映射容器端口到宿主主机
|
||||
* `-P or --publish-all=true|false` --映射容器所有端口到宿主主机
|
||||
|
||||
* `-h HOSTNAME` 或 `--hostname=HOSTNAME` 配置容器主机名
|
||||
* `--link=CONTAINER_NAME:ALIAS` 添加到另一个容器的连接
|
||||
* `--net=bridge|none|container:NAME_or_ID|host` 配置容器的桥接模式
|
||||
* `-p SPEC` 或 `--publish=SPEC` 映射容器端口到宿主主机
|
||||
* `-P or --publish-all=true|false` 映射容器所有端口到宿主主机
|
||||
|
||||
1
appendix/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# 附录
|
||||
@@ -1,56 +1,56 @@
|
||||
//dot -Tpng xx.dot -o xx.png
|
||||
digraph G {
|
||||
rankdir=TB;
|
||||
fontname = "Microsoft YaHei";
|
||||
fontsize = 14;
|
||||
penwidth = 3;
|
||||
compound=true;
|
||||
rankdir=LR;
|
||||
|
||||
node [shape = record];
|
||||
edge [fontname = "Arial", fontsize = 12, color="darkgreen" ];
|
||||
|
||||
image[label="Image",color=blue];
|
||||
registry[label="Registry",color=blue];
|
||||
tar[label="Tar files",color=blue];
|
||||
|
||||
subgraph cluster_container {
|
||||
label = "Container";
|
||||
style = "bold";
|
||||
color = blue;
|
||||
edge [fontname = "Arial", fontsize = 11, color="skyblue" ];
|
||||
//node [style=filled];
|
||||
run[label="Running",shape=circle, style=filled, fillcolor=green];
|
||||
stop[label="Stopped",shape=circle, style=filled, fillcolor=red];
|
||||
pause[label="Paused",shape=circle, style=filled, fillcolor=blue];
|
||||
|
||||
run->pause[label="pause"];
|
||||
pause->run[label="unpause"];
|
||||
run->run[label="restart"];
|
||||
run->stop[label="kill"];
|
||||
stop->run[label="start"];
|
||||
}
|
||||
|
||||
run->image[label="commit",ltail=cluster_container];
|
||||
image->run[label="start"];
|
||||
|
||||
image->tar[label="export|save"];
|
||||
tar->image[label="import"];
|
||||
|
||||
image->registry[label="push"];
|
||||
registry->image[label="pull"];
|
||||
|
||||
//heat[label="heat commands",color=blue];
|
||||
//heatshell[label="heatclient.shell.HeatShell",color=blue];
|
||||
//shell[label="{heatclient.v1.shell|+do_stack_create\l+do_stack_show\l+do_stack_update\l...\l+do_event_list\l...\l+do_resource_list\l...\l+do_resource_type_show\l...\l+do_template_show\l...\l}",color=blue];
|
||||
//heatclient[label="heatclient.client.Client",color=blue];
|
||||
//client[label="heatclient.v1.client.Client",color=blue];
|
||||
//httpclient[label="heatclient.common.http.HTTPClient",color=blue];
|
||||
|
||||
|
||||
|
||||
//openstackservices[label="{OpenStack Services|+Nova\l+Neutron\l+Keystone\l...}",color=blue];
|
||||
|
||||
//{rank=same; image cluster_container}
|
||||
//{rank=same; rpcproxy apimixin}
|
||||
}
|
||||
//dot -Tpng xx.dot -o xx.png
|
||||
digraph G {
|
||||
rankdir=TB;
|
||||
fontname = "Microsoft YaHei";
|
||||
fontsize = 14;
|
||||
penwidth = 3;
|
||||
compound=true;
|
||||
rankdir=LR;
|
||||
|
||||
node [shape = record];
|
||||
edge [fontname = "Arial", fontsize = 12, color="darkgreen" ];
|
||||
|
||||
image[label="Image",color=blue];
|
||||
registry[label="Registry",color=blue];
|
||||
tar[label="Tar files",color=blue];
|
||||
|
||||
subgraph cluster_container {
|
||||
label = "Container";
|
||||
style = "bold";
|
||||
color = blue;
|
||||
edge [fontname = "Arial", fontsize = 11, color="skyblue" ];
|
||||
//node [style=filled];
|
||||
run[label="Running",shape=circle, style=filled, fillcolor=green];
|
||||
stop[label="Stopped",shape=circle, style=filled, fillcolor=red];
|
||||
pause[label="Paused",shape=circle, style=filled, fillcolor=blue];
|
||||
|
||||
run->pause[label="pause"];
|
||||
pause->run[label="unpause"];
|
||||
run->run[label="restart"];
|
||||
run->stop[label="kill"];
|
||||
stop->run[label="start"];
|
||||
}
|
||||
|
||||
run->image[label="commit",ltail=cluster_container];
|
||||
image->run[label="start"];
|
||||
|
||||
image->tar[label="export|save"];
|
||||
tar->image[label="import"];
|
||||
|
||||
image->registry[label="push"];
|
||||
registry->image[label="pull"];
|
||||
|
||||
//heat[label="heat commands",color=blue];
|
||||
//heatshell[label="heatclient.shell.HeatShell",color=blue];
|
||||
//shell[label="{heatclient.v1.shell|+do_stack_create\l+do_stack_show\l+do_stack_update\l...\l+do_event_list\l...\l+do_resource_list\l...\l+do_resource_type_show\l...\l+do_template_show\l...\l}",color=blue];
|
||||
//heatclient[label="heatclient.client.Client",color=blue];
|
||||
//client[label="heatclient.v1.client.Client",color=blue];
|
||||
//httpclient[label="heatclient.common.http.HTTPClient",color=blue];
|
||||
|
||||
|
||||
|
||||
//openstackservices[label="{OpenStack Services|+Nova\l+Neutron\l+Keystone\l...}",color=blue];
|
||||
|
||||
//{rank=same; image cluster_container}
|
||||
//{rank=same; rpcproxy apimixin}
|
||||
}
|
||||
93
appendix/_images/cmd_logic.dot.bak
Normal file
@@ -0,0 +1,93 @@
|
||||
//dot -Tpng cmd_logic.dot -o cmd_logic.png
|
||||
digraph G {
|
||||
rankdir=TB;
|
||||
rankdir=LR;
|
||||
nodesep=1;
|
||||
//ranksep=1
|
||||
fontname = "Microsoft YaHei";
|
||||
fontsize = 28;
|
||||
penwidth = 4;
|
||||
compound=true;
|
||||
|
||||
node [shape = record];
|
||||
edge [fontname = "Arial", fontsize = 20, color="darkgreen" ];
|
||||
|
||||
user[label="User",color=blue,shape=ellipse, style=filled, fillcolor=green];
|
||||
dockerfile[label="Dockerfile",color=blue];
|
||||
daemon[label="Daemon",color=blue];
|
||||
image[label="Image",color=blue];
|
||||
registry[label="Registry",color=blue];
|
||||
tar[label="Tar files",color=blue];
|
||||
network[label="Network",color=blue]
|
||||
service[label="Service",color=blue]
|
||||
swarm[label="Swarm",color=blue]
|
||||
volume[label="Volume",color=blue]
|
||||
|
||||
subgraph cluster_container {
|
||||
label = "Container";
|
||||
labelloc = "c";
|
||||
nodesep=.5;
|
||||
style = "bold";
|
||||
color = blue;
|
||||
edge [fontname = "Arial", fontsize = 20, color="skyblue" ];
|
||||
//node [style=filled];
|
||||
create[label="Created",shape=circle, style=filled, fillcolor=lightblue];
|
||||
run[label="Running",shape=circle, style=filled, fillcolor=green];
|
||||
pause[label="Paused",shape=circle, style=filled, fillcolor=blue];
|
||||
stop[label="Stopped",shape=circle, style=filled, fillcolor=red];
|
||||
exit[label="Exited",shape=circle, style=filled, fillcolor=gray];
|
||||
|
||||
create->run[label=<<i>start</i>>];
|
||||
run->pause[label="pause"];
|
||||
pause->run[label="unpause"];
|
||||
run->run[label="restart"];
|
||||
run->stop[label="stop"];
|
||||
run->exit[label="kill"];
|
||||
stop->run[label="start"];
|
||||
}
|
||||
|
||||
//dockerfile
|
||||
dockerfile->image[label="build"];
|
||||
|
||||
//container
|
||||
run->image[headlabel="commit", labeldistance=7.5, ltail=cluster_container];
|
||||
run->tar[label="export",ltail=cluster_container];
|
||||
run->network[label="connect | disconnect",ltail=cluster_container];
|
||||
|
||||
//image
|
||||
image->create[label="create"];
|
||||
image->run[label="run"];
|
||||
image->tar[label="save"];
|
||||
image->registry[label="push"];
|
||||
|
||||
//tar
|
||||
tar->image[label="import | load"];
|
||||
image->registry[label="push"];
|
||||
|
||||
//registry
|
||||
registry->image[label="pull"];
|
||||
|
||||
//network
|
||||
network->network[label="create | rm | ls | inspect"]
|
||||
|
||||
//user
|
||||
user->run[label="attach | cp | diff | exec | inspect | logs | ps | rename | rm | stats | top | update | wait",lhead=cluster_container]
|
||||
user->image[label="history | images | rmi | tag"]
|
||||
user->daemon[label="event | info | version"]
|
||||
user->registry[label="login | logout | search"]
|
||||
|
||||
//heat[label="heat commands",color=blue];
|
||||
//heatshell[label="heatclient.shell.HeatShell",color=blue];
|
||||
//shell[label="{heatclient.v1.shell|+do_stack_create\l+do_stack_show\l+do_stack_update\l...\l+do_event_list\l...\l+do_resource_list\l...\l+do_resource_type_show\l...\l+do_template_show\l...\l}",color=blue];
|
||||
//heatclient[label="heatclient.client.Client",color=blue];
|
||||
//client[label="heatclient.v1.client.Client",color=blue];
|
||||
//httpclient[label="heatclient.common.http.HTTPClient",color=blue];
|
||||
|
||||
|
||||
|
||||
//openstackservices[label="{OpenStack Services|+Nova\l+Neutron\l+Keystone\l...}",color=blue];
|
||||
|
||||
//{rank=same; image registry dockerfile tar}
|
||||
//{rank=same; container}
|
||||
//{rank=same; user}
|
||||
}
|
||||
BIN
appendix/_images/cmd_logic.graffle/data.plist
Normal file
BIN
appendix/_images/cmd_logic.graffle/image10.pdf
Normal file
BIN
appendix/_images/cmd_logic.graffle/image11.pdf
Normal file
BIN
appendix/_images/cmd_logic.graffle/image12.pdf
Normal file
BIN
appendix/_images/cmd_logic.graffle/image13.pdf
Normal file
BIN
appendix/_images/cmd_logic.graffle/image4.pdf
Normal file
BIN
appendix/_images/cmd_logic.graffle/image5.pdf
Normal file
BIN
appendix/_images/cmd_logic.graffle/image6.pdf
Normal file
BIN
appendix/_images/cmd_logic.graffle/image7.pdf
Normal file
BIN
appendix/_images/cmd_logic.graffle/image9.pdf
Normal file
BIN
appendix/_images/cmd_logic.png
Normal file
|
After Width: | Height: | Size: 704 KiB |
51
appendix/_images/container_status.dot
Normal file
@@ -0,0 +1,51 @@
|
||||
//dot -Tpng container_status.dot -o container_status.png
|
||||
digraph G {
|
||||
rankdir=TB;
|
||||
rankdir=LR;
|
||||
nodesep=1;
|
||||
//ranksep=1
|
||||
fontname = "Microsoft YaHei";
|
||||
fontsize = 28;
|
||||
penwidth = 4;
|
||||
compound=true;
|
||||
style = "bold";
|
||||
color = blue;
|
||||
|
||||
node [shape = record];
|
||||
edge [fontname = "Arial", fontsize = 20, color="darkgreen" ];
|
||||
image[label="Image",color=blue];
|
||||
image->create[label="create"];
|
||||
image->run[label="run"];
|
||||
|
||||
edge [fontname = "Arial", fontsize = 20, color="skyblue" ];
|
||||
//node [style=filled];
|
||||
create[label="Created",shape=circle, style=filled, fillcolor=lightblue];
|
||||
run[label="Running",shape=circle, style=filled, fillcolor=green];
|
||||
pause[label="Paused",shape=circle, style=filled, fillcolor=blue];
|
||||
stop[label="Stopped",shape=circle, style=filled, fillcolor=red];
|
||||
exit[label="Exited",shape=circle, style=filled, fillcolor=gray];
|
||||
|
||||
create->run[label=<<i>start</i>>];
|
||||
run->pause[label="pause"];
|
||||
pause->run[label="unpause"];
|
||||
run->run[label="restart"];
|
||||
run->stop[label="stop"];
|
||||
run->exit[label="kill"];
|
||||
stop->run[label="start"];
|
||||
|
||||
|
||||
//heat[label="heat commands",color=blue];
|
||||
//heatshell[label="heatclient.shell.HeatShell",color=blue];
|
||||
//shell[label="{heatclient.v1.shell|+do_stack_create\l+do_stack_show\l+do_stack_update\l...\l+do_event_list\l...\l+do_resource_list\l...\l+do_resource_type_show\l...\l+do_template_show\l...\l}",color=blue];
|
||||
//heatclient[label="heatclient.client.Client",color=blue];
|
||||
//client[label="heatclient.v1.client.Client",color=blue];
|
||||
//httpclient[label="heatclient.common.http.HTTPClient",color=blue];
|
||||
|
||||
|
||||
|
||||
//openstackservices[label="{OpenStack Services|+Nova\l+Neutron\l+Keystone\l...}",color=blue];
|
||||
|
||||
//{rank=same; image registry dockerfile tar}
|
||||
//{rank=same; container}
|
||||
//{rank=same; user}
|
||||
}
|
||||
BIN
appendix/_images/container_status.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
1
appendix/best_practices.md
Normal file
@@ -0,0 +1 @@
|
||||
# [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)
|
||||
129
appendix/command/README.md
Normal file
@@ -0,0 +1,129 @@
|
||||
# Docker 命令查询
|
||||
|
||||
## 基本语法
|
||||
|
||||
Docker 命令有两大类,客户端命令和服务端命令。前者是主要的操作接口,后者用来启动 Docker Daemon。
|
||||
|
||||
* 客户端命令:基本命令格式为 `docker [OPTIONS] COMMAND [arg...]`;
|
||||
|
||||
* 服务端命令:基本命令格式为 `dockerd [OPTIONS]`。
|
||||
|
||||
可以通过 `man docker` 或 `docker help` 来查看这些命令。
|
||||
|
||||
## 客户端命令选项
|
||||
|
||||
* `--config=""`:指定客户端配置文件,默认为 `~/.docker`;
|
||||
* `-D=true|false`:是否使用 debug 模式。默认不开启;
|
||||
* `-H, --host=[]`:指定命令对应 Docker 守护进程的监听接口,可以为 unix 套接字 `unix:///path/to/socket`,文件句柄 `fd://socketfd` 或 tcp 套接字 `tcp://[host[:port]]`,默认为 `unix:///var/run/docker.sock`;
|
||||
* `-l, --log-level="debug|info|warn|error|fatal"`:指定日志输出级别;
|
||||
* `--tls=true|false`:是否对 Docker 守护进程启用 TLS 安全机制,默认为否;
|
||||
* `--tlscacert=/.docker/ca.pem`:TLS CA 签名的可信证书文件路径;
|
||||
* `--tlscert=/.docker/cert.pem`:TLS 可信证书文件路径;
|
||||
* `--tlscert=/.docker/key.pem`:TLS 密钥文件路径;
|
||||
* `--tlsverify=true|false`:启用 TLS 校验,默认为否。
|
||||
|
||||
## dockerd 命令选项
|
||||
|
||||
* `--api-cors-header=""`:CORS 头部域,默认不允许 CORS,要允许任意的跨域访问,可以指定为 "*";
|
||||
* `--authorization-plugin=""`:载入认证的插件;
|
||||
* `-b=""`:将容器挂载到一个已存在的网桥上。指定为 `none` 时则禁用容器的网络,与 `--bip` 选项互斥;
|
||||
* `--bip=""`:让动态创建的 `docker0` 网桥采用给定的 CIDR 地址; 与 `-b` 选项互斥;
|
||||
* `--cgroup-parent=""`:指定 cgroup 的父组,默认 fs cgroup 驱动为 `/docker`,systemd cgroup 驱动为 `system.slice`;
|
||||
* `--cluster-store=""`:构成集群(如 `Swarm`)时,集群键值数据库服务地址;
|
||||
* `--cluster-advertise=""`:构成集群时,自身的被访问地址,可以为 `host:port` 或 `interface:port`;
|
||||
* `--cluster-store-opt=""`:构成集群时,键值数据库的配置选项;
|
||||
* `--config-file="/etc/docker/daemon.json"`:daemon 配置文件路径;
|
||||
* `--containerd=""`:containerd 文件的路径;
|
||||
* `-D, --debug=true|false`:是否使用 Debug 模式。缺省为 false;
|
||||
* `--default-gateway=""`:容器的 IPv4 网关地址,必须在网桥的子网段内;
|
||||
* `--default-gateway-v6=""`:容器的 IPv6 网关地址;
|
||||
* `--default-ulimit=[]`:默认的 ulimit 值;
|
||||
* `--disable-legacy-registry=true|false`:是否允许访问旧版本的镜像仓库服务器;
|
||||
* `--dns=""`:指定容器使用的 DNS 服务器地址;
|
||||
* `--dns-opt=""`:DNS 选项;
|
||||
* `--dns-search=[]`:DNS 搜索域;
|
||||
* `--exec-opt=[]`:运行时的执行选项;
|
||||
* `--exec-root=""`:容器执行状态文件的根路径,默认为 `/var/run/docker`;
|
||||
* `--fixed-cidr=""`:限定分配 IPv4 地址范围;
|
||||
* `--fixed-cidr-v6=""`:限定分配 IPv6 地址范围;
|
||||
* `-G, --group=""`:分配给 unix 套接字的组,默认为 `docker`;
|
||||
* `-g, --graph=""`:Docker 运行时的根路径,默认为 `/var/lib/docker`;
|
||||
* `-H, --host=[]`:指定命令对应 Docker daemon 的监听接口,可以为 unix 套接字 `unix:///path/to/socket`,文件句柄 `fd://socketfd` 或 tcp 套接字 `tcp://[host[:port]]`,默认为 `unix:///var/run/docker.sock`;
|
||||
* `--icc=true|false`:是否启用容器间以及跟 daemon 所在主机的通信。默认为 true。
|
||||
* `--insecure-registry=[]`:允许访问给定的非安全仓库服务;
|
||||
* `--ip=""`:绑定容器端口时候的默认 IP 地址。缺省为 `0.0.0.0`;
|
||||
* `--ip-forward=true|false`:是否检查启动在 Docker 主机上的启用 IP 转发服务,默认开启。注意关闭该选项将不对系统转发能力进行任何检查修改;
|
||||
* `--ip-masq=true|false`:是否进行地址伪装,用于容器访问外部网络,默认开启;
|
||||
* `--iptables=true|false`:是否允许 Docker 添加 iptables 规则。缺省为 true;
|
||||
* `--ipv6=true|false`:是否启用 IPv6 支持,默认关闭;
|
||||
* `-l, --log-level="debug|info|warn|error|fatal"`:指定日志输出级别;
|
||||
* `--label="[]"`:添加指定的键值对标注;
|
||||
* `--log-driver="json-file|syslog|journald|gelf|fluentd|awslogs|splunk|etwlogs|gcplogs|none"`:指定日志后端驱动,默认为 `json-file`;
|
||||
* `--log-opt=[]`:日志后端的选项;
|
||||
* `--mtu=VALUE`:指定容器网络的 `mtu`;
|
||||
* `-p=""`:指定 daemon 的 PID 文件路径。缺省为 `/var/run/docker.pid`;
|
||||
* `--raw-logs`:输出原始,未加色彩的日志信息;
|
||||
* `--registry-mirror=<scheme>://<host>`:指定 `docker pull` 时使用的注册服务器镜像地址;
|
||||
* `-s, --storage-driver=""`:指定使用给定的存储后端;
|
||||
* `--selinux-enabled=true|false`:是否启用 SELinux 支持。缺省值为 false。SELinux 目前尚不支持 overlay 存储驱动;
|
||||
* `--storage-opt=[]`:驱动后端选项;
|
||||
* `--tls=true|false`:是否对 Docker daemon 启用 TLS 安全机制,默认为否;
|
||||
* `--tlscacert=/.docker/ca.pem`:TLS CA 签名的可信证书文件路径;
|
||||
* `--tlscert=/.docker/cert.pem`:TLS 可信证书文件路径;
|
||||
* `--tlscert=/.docker/key.pem`:TLS 密钥文件路径;
|
||||
* `--tlsverify=true|false`:启用 TLS 校验,默认为否;
|
||||
* `--userland-proxy=true|false`:是否使用用户态代理来实现容器间和出容器的回环通信,默认为 true;
|
||||
* `--userns-remap=default|uid:gid|user:group|user|uid`:指定容器的用户命名空间,默认是创建新的 UID 和 GID 映射到容器内进程。
|
||||
|
||||
## 客户端命令
|
||||
|
||||
可以通过 `docker COMMAND --help` 来查看这些命令的具体用法。
|
||||
|
||||
* `attach`:依附到一个正在运行的容器中;
|
||||
* `build`:从一个 Dockerfile 创建一个镜像;
|
||||
* `commit`:从一个容器的修改中创建一个新的镜像;
|
||||
* `cp`:在容器和本地宿主系统之间复制文件中;
|
||||
* `create`:创建一个新容器,但并不运行它;
|
||||
* `diff`:检查一个容器内文件系统的修改,包括修改和增加;
|
||||
* `events`:从服务端获取实时的事件;
|
||||
* `exec`:在运行的容器内执行命令;
|
||||
* `export`:导出容器内容为一个 `tar` 包;
|
||||
* `history`:显示一个镜像的历史信息;
|
||||
* `images`:列出存在的镜像;
|
||||
* `import`:导入一个文件(典型为 `tar` 包)路径或目录来创建一个本地镜像;
|
||||
* `info`:显示一些相关的系统信息;
|
||||
* `inspect`:显示一个容器的具体配置信息;
|
||||
* `kill`:关闭一个运行中的容器 (包括进程和所有相关资源);
|
||||
* `load`:从一个 tar 包中加载一个镜像;
|
||||
* `login`:注册或登录到一个 Docker 的仓库服务器;
|
||||
* `logout`:从 Docker 的仓库服务器登出;
|
||||
* `logs`:获取容器的 log 信息;
|
||||
* `network`:管理 Docker 的网络,包括查看、创建、删除、挂载、卸载等;
|
||||
* `node`:管理 swarm 集群中的节点,包括查看、更新、删除、提升/取消管理节点等;
|
||||
* `pause`:暂停一个容器中的所有进程;
|
||||
* `port`:查找一个 nat 到一个私有网口的公共口;
|
||||
* `ps`:列出主机上的容器;
|
||||
* `pull`:从一个Docker的仓库服务器下拉一个镜像或仓库;
|
||||
* `push`:将一个镜像或者仓库推送到一个 Docker 的注册服务器;
|
||||
* `rename`:重命名一个容器;
|
||||
* `restart`:重启一个运行中的容器;
|
||||
* `rm`:删除给定的若干个容器;
|
||||
* `rmi`:删除给定的若干个镜像;
|
||||
* `run`:创建一个新容器,并在其中运行给定命令;
|
||||
* `save`:保存一个镜像为 tar 包文件;
|
||||
* `search`:在 Docker index 中搜索一个镜像;
|
||||
* `service`:管理 Docker 所启动的应用服务,包括创建、更新、删除等;
|
||||
* `start`:启动一个容器;
|
||||
* `stats`:输出(一个或多个)容器的资源使用统计信息;
|
||||
* `stop`:终止一个运行中的容器;
|
||||
* `swarm`:管理 Docker swarm 集群,包括创建、加入、退出、更新等;
|
||||
* `tag`:为一个镜像打标签;
|
||||
* `top`:查看一个容器中的正在运行的进程信息;
|
||||
* `unpause`:将一个容器内所有的进程从暂停状态中恢复;
|
||||
* `update`:更新指定的若干容器的配置信息;
|
||||
* `version`:输出 Docker 的版本信息;
|
||||
* `volume`:管理 Docker volume,包括查看、创建、删除等;
|
||||
* `wait`:阻塞直到一个容器终止,然后输出它的退出符。
|
||||
|
||||
## 一张图总结 Docker 的命令
|
||||

|
||||
42
appendix/debug.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# 如何调试 Docker
|
||||
|
||||
## 开启 Debug 模式
|
||||
|
||||
在 dockerd 配置文件 daemon.json(默认位于 /etc/docker/)中添加
|
||||
|
||||
```json
|
||||
{
|
||||
"debug": true
|
||||
}
|
||||
```
|
||||
|
||||
重启守护进程。
|
||||
|
||||
```bash
|
||||
$ sudo kill -SIGHUP $(pidof dockerd)
|
||||
```
|
||||
|
||||
此时 dockerd 会在日志中输入更多信息供分析。
|
||||
|
||||
## 检查内核日志
|
||||
|
||||
```bash
|
||||
$ sudo dmesag |grep dockerd
|
||||
$ sudo dmesag |grep runc
|
||||
```
|
||||
|
||||
## Docker 不响应时处理
|
||||
|
||||
可以杀死 dockerd 进程查看其堆栈调用情况。
|
||||
|
||||
```bash
|
||||
$ sudo kill -SIGUSR1 $(pidof dockerd)
|
||||
```
|
||||
|
||||
## 重置 Docker 本地数据
|
||||
|
||||
*注意,本操作会移除所有的 Docker 本地数据,包括镜像和容器等。*
|
||||
|
||||
```bash
|
||||
$ sudo rm -rf /var/lib/docker
|
||||
```
|
||||
214
appendix/faq/README.md
Normal file
@@ -0,0 +1,214 @@
|
||||
# 常见问题总结
|
||||
|
||||
## 镜像相关
|
||||
|
||||
### 如何批量清理临时镜像文件?
|
||||
|
||||
答:可以使用 `docker image prune` 命令。
|
||||
|
||||
### 如何查看镜像支持的环境变量?
|
||||
|
||||
答:可以使用 `docker run IMAGE env` 命令。
|
||||
|
||||
### 本地的镜像文件都存放在哪里?
|
||||
|
||||
答:与 Docker 相关的本地资源默认存放在 `/var/lib/docker/` 目录下,以 `aufs` 文件系统为例,其中 `container` 目录存放容器信息,`graph` 目录存放镜像信息,`aufs` 目录下存放具体的镜像层文件。
|
||||
|
||||
### 构建 Docker 镜像应该遵循哪些原则?
|
||||
|
||||
答:整体原则上,尽量保持镜像功能的明确和内容的精简,要点包括
|
||||
|
||||
* 尽量选取满足需求但较小的基础系统镜像,例如大部分时候可以选择 debian:wheezy 或 debian:stretch 镜像,仅有不足百兆大小;
|
||||
|
||||
* 清理编译生成文件、安装包的缓存等临时文件;
|
||||
|
||||
* 安装各个软件时候要指定准确的版本号,并避免引入不需要的依赖;
|
||||
|
||||
* 从安全角度考虑,应用要尽量使用系统的库和依赖;
|
||||
|
||||
* 如果安装应用时候需要配置一些特殊的环境变量,在安装后要还原不需要保持的变量值;
|
||||
|
||||
* 使用 Dockerfile 创建镜像时候要添加 .dockerignore 文件或使用干净的工作目录。
|
||||
|
||||
更多内容请查看 [Dockerfile 最佳实践](../best_practices.md)
|
||||
|
||||
### 碰到网络问题,无法 pull 镜像,命令行指定 http_proxy 无效?
|
||||
|
||||
答:在 Docker 配置文件中添加 `export http_proxy="http://<PROXY_HOST>:<PROXY_PORT>"`,之后重启 Docker 服务即可。
|
||||
|
||||
## 容器相关
|
||||
|
||||
### 容器退出后,通过 docker container ls 命令查看不到,数据会丢失么?
|
||||
|
||||
答:容器退出后会处于终止(exited)状态,此时可以通过 `docker container ls -a` 查看。其中的数据也不会丢失,还可以通过 `docker start` 命令来启动它。只有删除掉容器才会清除所有数据。
|
||||
|
||||
### 如何停止所有正在运行的容器?
|
||||
|
||||
答:可以使用 `docker stop $(docker container ls -q)` 命令。
|
||||
|
||||
### 如何批量清理已经停止的容器?
|
||||
|
||||
答:可以使用 `docker container prune` 命令。
|
||||
|
||||
### 如何获取某个容器的 PID 信息?
|
||||
|
||||
答:可以使用 `docker inspect --format '{{ .State.Pid }}' <CONTAINER ID or NAME>` 命令。
|
||||
|
||||
### 如何获取某个容器的 IP 地址?
|
||||
|
||||
答:可以使用 `docker inspect --format '{{ .NetworkSettings.IPAddress }}' <CONTAINER ID or NAME>` 命令
|
||||
|
||||
### 如何给容器指定一个固定 IP 地址,而不是每次重启容器 IP 地址都会变?
|
||||
|
||||
答:使用以下命令启动容器可以使容器 IP 固定不变
|
||||
|
||||
```bash
|
||||
$ docker network create -d bridge --subnet 172.25.0.0/16 my-net
|
||||
|
||||
$ docker run --network=my-net --ip=172.25.3.3 -itd --name=my-container busybox
|
||||
```
|
||||
|
||||
### 如何临时退出一个正在交互的容器的终端,而不终止它?
|
||||
|
||||
答:按 `Ctrl-p Ctrl-q`。如果按 `Ctrl-c` 往往会让容器内应用进程终止,进而会终止容器。
|
||||
|
||||
### 使用 `docker port` 命令映射容器的端口时,系统报错“Error: No public port '80' published for xxx”?
|
||||
|
||||
答:
|
||||
|
||||
* 创建镜像时 `Dockerfile` 要通过 `EXPOSE` 指定正确的开放端口;
|
||||
|
||||
* 容器启动时指定 `PublishAllPort = true`。
|
||||
|
||||
### 可以在一个容器中同时运行多个应用进程么?
|
||||
|
||||
答:一般并不推荐在同一个容器内运行多个应用进程。如果有类似需求,可以通过一些额外的进程管理机制,比如 `supervisord` 来管理所运行的进程。可以参考 https://docs.docker.com/config/containers/multi-service_container/ 。
|
||||
|
||||
### 如何控制容器占用系统资源(CPU、内存)的份额?
|
||||
|
||||
答:在使用 `docker create` 命令创建容器或使用 `docker run` 创建并启动容器的时候,可以使用 -c|--cpu-shares[=0] 参数来调整容器使用 CPU 的权重;使用 -m|--memory[=MEMORY] 参数来调整容器使用内存的大小。
|
||||
|
||||
## 仓库相关
|
||||
|
||||
### 仓库(Repository)、注册服务器(Registry)、注册索引(Index) 有何关系?
|
||||
|
||||
首先,仓库是存放一组关联镜像的集合,比如同一个应用的不同版本的镜像。
|
||||
|
||||
注册服务器是存放实际的镜像文件的地方。注册索引则负责维护用户的账号、权限、搜索、标签等的管理。因此,注册服务器利用注册索引来实现认证等管理。
|
||||
|
||||
## 配置相关
|
||||
|
||||
### Docker 的配置文件放在哪里,如何修改配置?
|
||||
|
||||
答:使用 `systemd` 的系统(如 Ubuntu 16.04、Centos 等)的配置文件在 `/etc/docker/daemon.json`。
|
||||
|
||||
|
||||
### 如何更改 Docker 的默认存储位置?
|
||||
|
||||
答:Docker 的默认存储位置是 `/var/lib/docker`,如果希望将 Docker 的本地文件存储到其他分区,可以使用 Linux 软连接的方式来完成,或者在启动 daemon 时通过 `-g` 参数指定,或者修改配置文件 `/etc/docker/daemon.json` 的 "data-root" 项 。可以使用 `docker system info | grep "Root Dir"` 查看当前使用的存储位置。
|
||||
|
||||
例如,如下操作将默认存储位置迁移到 /storage/docker。
|
||||
|
||||
```sh
|
||||
[root@s26 ~]# df -h
|
||||
Filesystem Size Used Avail Use% Mounted on
|
||||
/dev/mapper/VolGroup-lv_root 50G 5.3G 42G 12% /
|
||||
tmpfs 48G 228K 48G 1% /dev/shm
|
||||
/dev/sda1 485M 40M 420M 9% /boot
|
||||
/dev/mapper/VolGroup-lv_home 222G 188M 210G 1% /home
|
||||
/dev/sdb2 2.7T 323G 2.3T 13% /storage
|
||||
[root@s26 ~]# service docker stop
|
||||
[root@s26 ~]# cd /var/lib/
|
||||
[root@s26 lib]# mv docker /storage/
|
||||
[root@s26 lib]# ln -s /storage/docker/ docker
|
||||
[root@s26 lib]# ls -la docker
|
||||
lrwxrwxrwx. 1 root root 15 11月 17 13:43 docker -> /storage/docker
|
||||
[root@s26 lib]# service docker start
|
||||
```
|
||||
|
||||
### 使用内存和 swap 限制启动容器时候报警告:"WARNING: Your kernel does not support cgroup swap limit. WARNING: Your kernel does not support swap limit capabilities. Limitation discarded."?
|
||||
|
||||
答:这是因为系统默认没有开启对内存和 swap 使用的统计功能,引入该功能会带来性能的下降。要开启该功能,可以采取如下操作:
|
||||
|
||||
* 编辑 `/etc/default/grub` 文件(Ubuntu 系统为例),配置 `GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"`
|
||||
|
||||
* 更新 grub:`$ sudo update-grub`
|
||||
|
||||
* 重启系统,即可。
|
||||
|
||||
## Docker 与虚拟化
|
||||
|
||||
### Docker 与 LXC(Linux Container)有何不同?
|
||||
|
||||
答:LXC 利用 Linux 上相关技术实现了容器。Docker 则在如下的几个方面进行了改进:
|
||||
* 移植性:通过抽象容器配置,容器可以实现从一个平台移植到另一个平台;
|
||||
* 镜像系统:基于 AUFS 的镜像系统为容器的分发带来了很多的便利,同时共同的镜像层只需要存储一份,实现高效率的存储;
|
||||
* 版本管理:类似于Git的版本管理理念,用户可以更方便的创建、管理镜像文件;
|
||||
* 仓库系统:仓库系统大大降低了镜像的分发和管理的成本;
|
||||
* 周边工具:各种现有工具(配置管理、云平台)对 Docker 的支持,以及基于 Docker的 PaaS、CI 等系统,让 Docker 的应用更加方便和多样化。
|
||||
|
||||
### Docker 与 Vagrant 有何不同?
|
||||
|
||||
答:两者的定位完全不同。
|
||||
|
||||
* Vagrant 类似 Boot2Docker(一款运行 Docker 的最小内核),是一套虚拟机的管理环境。Vagrant 可以在多种系统上和虚拟机软件中运行,可以在 Windows,Mac 等非 Linux 平台上为 Docker 提供支持,自身具有较好的包装性和移植性。
|
||||
|
||||
* 原生的 Docker 自身只能运行在 Linux 平台上,但启动和运行的性能都比虚拟机要快,往往更适合快速开发和部署应用的场景。
|
||||
|
||||
简单说:Vagrant 适合用来管理虚拟机,而 Docker 适合用来管理应用环境。
|
||||
|
||||
### 开发环境中 Docker 和 Vagrant 该如何选择?
|
||||
|
||||
答:Docker 不是虚拟机,而是进程隔离,对于资源的消耗很少,但是目前需要 Linux 环境支持。Vagrant 是虚拟机上做的封装,虚拟机本身会消耗资源。
|
||||
|
||||
如果本地使用的 Linux 环境,推荐都使用 Docker。
|
||||
|
||||
如果本地使用的是 macOS 或者 Windows 环境,那就需要开虚拟机,单一开发环境下 Vagrant 更简单;多环境开发下推荐在 Vagrant 里面再使用 Docker 进行环境隔离。
|
||||
|
||||
## 其它
|
||||
|
||||
### Docker 能在非 Linux 平台(比如 Windows 或 macOS )上运行么?
|
||||
|
||||
答:完全可以。安装方法请查看 [安装 Docker](../../install/) 一节
|
||||
|
||||
### 如何将一台宿主主机的 Docker 环境迁移到另外一台宿主主机?
|
||||
|
||||
答:停止 Docker 服务。将整个 Docker 存储文件夹复制到另外一台宿主主机,然后调整另外一台宿主主机的配置即可。
|
||||
|
||||
### 如何进入 Docker 容器的网络命名空间?
|
||||
|
||||
答:Docker 在创建容器后,删除了宿主主机上 `/var/run/netns` 目录中的相关的网络命名空间文件。因此,在宿主主机上是无法看到或访问容器的网络命名空间的。
|
||||
|
||||
用户可以通过如下方法来手动恢复它。
|
||||
|
||||
首先,使用下面的命令查看容器进程信息,比如这里的 1234。
|
||||
|
||||
```bash
|
||||
$ docker inspect --format='{{. State.Pid}} ' $container_id
|
||||
1234
|
||||
```
|
||||
|
||||
接下来,在 `/proc` 目录下,把对应的网络命名空间文件链接到 `/var/run/netns` 目录。
|
||||
|
||||
```bash
|
||||
$ sudo ln -s /proc/1234/ns/net /var/run/netns/
|
||||
```
|
||||
|
||||
然后,在宿主主机上就可以看到容器的网络命名空间信息。例如
|
||||
|
||||
```bash
|
||||
$ sudo ip netns show
|
||||
1234
|
||||
```
|
||||
|
||||
此时,用户可以通过正常的系统命令来查看或操作容器的命名空间了。例如修改容器的 IP 地址信息为 `172.17.0.100/16`。
|
||||
|
||||
```bash
|
||||
$ sudo ip netns exec 1234 ifconfig eth0 172.17.0.100/16
|
||||
```
|
||||
|
||||
### 如何获取容器绑定到本地那个 veth 接口上?
|
||||
|
||||
答:Docker 容器启动后,会通过 veth 接口对连接到本地网桥,veth 接口命名跟容器命名毫无关系,十分难以找到对应关系。
|
||||
|
||||
最简单的一种方式是通过查看接口的索引号,在容器中执行 `ip a` 命令,查看到本地接口最前面的接口索引号,如 `205`,将此值加上 1,即 `206`,然后在本地主机执行 `ip a` 命令,查找接口索引号为 `206` 的接口,两者即为连接的 veth 接口对。
|
||||
3
appendix/repo/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# 热门镜像介绍
|
||||
|
||||
本章将介绍一些热门镜像的功能,使用方法等。包括 Ubuntu、CentOS、MySQL、MongoDB、Redis、Nginx、Wordpress、Node.js 等。
|
||||
20
appendix/repo/centos.md
Normal file
@@ -0,0 +1,20 @@
|
||||
## [CentOS](https://hub.docker.com/_/centos)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[CentOS](https://en.wikipedia.org/wiki/CentOS) 是流行的 Linux 发行版,其软件包大多跟 RedHat 系列保持一致。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/centos` ,提供了 CentOS 从 5 ~ 7 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
默认会启动一个最小化的 CentOS 环境。
|
||||
|
||||
```bash
|
||||
$ docker run --name centos -it centos bash
|
||||
bash-4.2#
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/centos 查看。
|
||||
34
appendix/repo/mongodb.md
Normal file
@@ -0,0 +1,34 @@
|
||||
## [MongoDB](https://hub.docker.com/_/mongo/)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[MongoDB](https://en.wikipedia.org/wiki/MongoDB) 是开源的 NoSQL 数据库实现。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/mongo/` ,提供了 MongoDB 2.x ~ 4.x 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
默认会在 `27017` 端口启动数据库。
|
||||
|
||||
```bash
|
||||
$ docker run --name mongo -d mongo
|
||||
```
|
||||
|
||||
使用其他应用连接到容器,可以用
|
||||
|
||||
```bash
|
||||
$ docker run --name some-app --link some-mongo:mongo -d application-that-uses-mongo
|
||||
```
|
||||
|
||||
或者通过 `mongo`
|
||||
|
||||
```bash
|
||||
$ docker run -it --rm \
|
||||
--link some-mongo:mongo \
|
||||
mongo \
|
||||
sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"'
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/mongo 查看。
|
||||
34
appendix/repo/mysql.md
Normal file
@@ -0,0 +1,34 @@
|
||||
## [MySQL](https://hub.docker.com/_/mysql/)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[MySQL](https://en.wikipedia.org/wiki/MySQL) 是开源的关系数据库实现。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/mysql/` ,提供了 MySQL 5.5 ~ 8.x 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
默认会在 `3306` 端口启动数据库。
|
||||
|
||||
```bash
|
||||
$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql
|
||||
```
|
||||
|
||||
之后就可以使用其它应用来连接到该容器。
|
||||
|
||||
```bash
|
||||
$ docker run --name some-app --link some-mysql:mysql -d application-that-uses-mysql
|
||||
```
|
||||
|
||||
或者通过 `mysql` 命令行连接。
|
||||
|
||||
```bash
|
||||
$ docker run -it --rm \
|
||||
--link some-mysql:mysql \
|
||||
mysql \
|
||||
sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/mysql 查看
|
||||
@@ -1,34 +1,48 @@
|
||||
## [Nginx](https://registry.hub.docker.com/_/nginx/)
|
||||
## [Nginx](https://hub.docker.com/_/nginx/)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[Nginx](https://en.wikipedia.org/wiki/Nginx) 是开源的高效的 Web 服务器实现,支持 HTTP、HTTPS、SMTP、POP3、IMAP 等协议。
|
||||
该仓库提供了 Nginx 1.0 ~ 1.7 各个版本的镜像。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/nginx/` ,提供了 Nginx 1.0 ~ 1.17.x 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
下面的命令将作为一个静态页面服务器启动。
|
||||
|
||||
```bash
|
||||
$ docker run --name some-nginx -v /some/content:/usr/share/nginx/html:ro -d nginx
|
||||
```
|
||||
$ sudo docker run --name some-nginx -v /some/content:/usr/share/nginx/html:ro -d nginx
|
||||
```
|
||||
|
||||
用户也可以不使用这种映射方式,通过利用 Dockerfile 来直接将静态页面内容放到镜像中,内容为
|
||||
```
|
||||
|
||||
```bash
|
||||
FROM nginx
|
||||
COPY static-html-directory /usr/share/nginx/html
|
||||
```
|
||||
|
||||
之后生成新的镜像,并启动一个容器。
|
||||
|
||||
```bash
|
||||
$ docker build -t some-content-nginx .
|
||||
$ docker run --name some-nginx -d some-content-nginx
|
||||
```
|
||||
$ sudo docker build -t some-content-nginx .
|
||||
$ sudo docker run --name some-nginx -d some-content-nginx
|
||||
```
|
||||
|
||||
开放端口,并映射到本地的 `8080` 端口。
|
||||
```
|
||||
sudo docker run --name some-nginx -d -p 8080:80 some-content-nginx
|
||||
|
||||
```bash
|
||||
$ docker run --name some-nginx -d -p 8080:80 some-content-nginx
|
||||
```
|
||||
|
||||
Nginx的默认配置文件路径为 `/etc/nginx/nginx.conf`,可以通过映射它来使用本地的配置文件,例如
|
||||
|
||||
```bash
|
||||
$ docker run -d \
|
||||
--name some-nginx \
|
||||
-v /some/nginx.conf:/etc/nginx/nginx.conf:ro \
|
||||
nginx
|
||||
```
|
||||
docker run --name some-nginx -v /some/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx
|
||||
```
|
||||
使用配置文件时,为了在容器中正常运行,需要保持 `daemon off;`。
|
||||
|
||||
### Dockerfile
|
||||
* [1 ~ 1.7 版本](https://github.com/nginxinc/docker-nginx/blob/3713a0157083eb4776e71f5a5aef4b2a5bc03ab1/Dockerfile)
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/nginx 查看。
|
||||
40
appendix/repo/nodejs.md
Normal file
@@ -0,0 +1,40 @@
|
||||
## [Node.js](https://hub.docker.com/_/node/)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[Node.js](https://en.wikipedia.org/wiki/Node.js) 是基于 JavaScript 的可扩展服务端和网络软件开发平台。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/node/` ,提供了 Node.js 0.10 ~ 12.x 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
在项目中创建一个 Dockerfile。
|
||||
|
||||
```bash
|
||||
FROM node:9
|
||||
# replace this with your application's default port
|
||||
EXPOSE 8888
|
||||
```
|
||||
|
||||
然后创建镜像,并启动容器。
|
||||
|
||||
```bash
|
||||
$ docker build -t my-nodejs-app
|
||||
$ docker run -it --rm --name my-running-app my-nodejs-app
|
||||
```
|
||||
|
||||
也可以直接运行一个简单容器。
|
||||
|
||||
```bash
|
||||
$ docker run -it --rm \
|
||||
--name my-running-script \
|
||||
# -v "$(pwd)":/usr/src/myapp \
|
||||
--mount type=bind,src=`$(pwd)`,target=/usr/src/myapp \
|
||||
-w /usr/src/myapp \
|
||||
node:9-alpine \
|
||||
node your-daemon-or-script.js
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/node 查看。
|
||||
19
appendix/repo/php.md
Normal file
@@ -0,0 +1,19 @@
|
||||
## [PHP](https://hub.docker.com/_/php/)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[PHP](https://en.wikipedia.org/wiki/php)(Hypertext Preprocessor 超文本预处理器的字母缩写)是一种被广泛应用的开放源代码的多用途脚本语言,它可嵌入到 HTML 中,尤其适合 web 开发。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/php/` ,提供了 PHP 5.x ~ 7.x 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
下面的命令将运行一个已有的 PHP 脚本。
|
||||
|
||||
```bash
|
||||
$ docker run -it --rm -v "$PWD":/app -w /app php:alpine php your-script.php
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/php 查看。
|
||||
42
appendix/repo/redis.md
Normal file
@@ -0,0 +1,42 @@
|
||||
## [Redis](https://hub.docker.com/_/redis/)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[Redis](https://en.wikipedia.org/wiki/Redis) 是开源的内存 Key-Value 数据库实现。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/redis/` ,提供了 Redis 3.x ~ 5.x 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
默认会在 `6379` 端口启动数据库。
|
||||
|
||||
```bash
|
||||
$ docker run --name some-redis -d -p 6379:6379 redis
|
||||
```
|
||||
|
||||
另外还可以启用 [持久存储](https://redis.io/topics/persistence)。
|
||||
|
||||
```bash
|
||||
$ docker run --name some-redis -d -p 6379:6379 redis redis-server --appendonly yes
|
||||
```
|
||||
|
||||
默认数据存储位置在 `VOLUME/data`。可以使用 `--volumes-from some-volume-container` 或 `-v /docker/host/dir:/data` 将数据存放到本地。
|
||||
|
||||
使用其他应用连接到容器,可以用
|
||||
|
||||
```bash
|
||||
$ docker run --name some-app --link some-redis:redis -d application-that-uses-redis
|
||||
```
|
||||
|
||||
或者通过 `redis-cli`
|
||||
|
||||
```bash
|
||||
$ docker run -it --rm \
|
||||
--link some-redis:redis \
|
||||
redis \
|
||||
sh -c 'exec redis-cli -h "$REDIS_PORT_6379_TCP_ADDR" -p "$REDIS_PORT_6379_TCP_PORT"'
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/redis 查看。
|
||||
20
appendix/repo/ubuntu.md
Normal file
@@ -0,0 +1,20 @@
|
||||
## [Ubuntu](https://hub.docker.com/_/ubuntu/)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[Ubuntu](https://en.wikipedia.org/wiki/Ubuntu) 是流行的 Linux 发行版,其自带软件版本往往较新一些。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/ubuntu/` ,提供了 Ubuntu 从 12.04 ~ 19.04 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
默认会启动一个最小化的 Ubuntu 环境。
|
||||
|
||||
```bash
|
||||
$ docker run --name some-ubuntu -it ubuntu:18.04
|
||||
root@523c70904d54:/#
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/ubuntu 查看。
|
||||
25
appendix/repo/wordpress.md
Normal file
@@ -0,0 +1,25 @@
|
||||
## [WordPress](https://hub.docker.com/_/wordpress/)
|
||||
|
||||
### 基本信息
|
||||
|
||||
[WordPress](https://en.wikipedia.org/wiki/WordPress) 是开源的 Blog 和内容管理系统框架,它基于 PHP 和 MySQL。
|
||||
|
||||
该仓库位于 `https://hub.docker.com/_/wordpress/` ,提供了 WordPress 4.x ~ 5.x 版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
|
||||
启动容器需要 MySQL 的支持,默认端口为 `80`。
|
||||
|
||||
```bash
|
||||
$ docker run --name some-wordpress --link some-mysql:mysql -d wordpress
|
||||
```
|
||||
|
||||
启动 WordPress 容器时可以指定的一些环境变量包括:
|
||||
|
||||
* `WORDPRESS_DB_USER` 缺省为 `root`
|
||||
* `WORDPRESS_DB_PASSWORD` 缺省为连接 mysql 容器的环境变量 `MYSQL_ROOT_PASSWORD` 的值
|
||||
* `WORDPRESS_DB_NAME` 缺省为 `wordpress`
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/wordpress 查看。
|
||||
27
appendix/resources.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# 资源链接
|
||||
|
||||
## 官方网站
|
||||
|
||||
* Docker 官方主页:https://www.docker.com
|
||||
* Docker 官方博客:https://blog.docker.com/
|
||||
* Docker 官方文档:https://docs.docker.com/
|
||||
* Docker Hub:https://hub.docker.com
|
||||
* Docker 的源代码仓库:https://github.com/moby/moby
|
||||
* Docker 发布版本历史:https://docs.docker.com/release-notes/
|
||||
* Docker 常见问题:https://docs.docker.com/engine/faq/
|
||||
* Docker 远端应用 API:https://docs.docker.com/develop/sdk/
|
||||
|
||||
## 实践参考
|
||||
|
||||
* Dockerfile 参考:https://docs.docker.com/engine/reference/builder/
|
||||
* Dockerfile 最佳实践:https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/
|
||||
|
||||
## 技术交流
|
||||
|
||||
* Docker 邮件列表: https://groups.google.com/forum/#!forum/docker-user
|
||||
* Docker 的 IRC 频道:https://chat.freenode.net#docker
|
||||
* Docker 的 Twitter 主页:https://twitter.com/docker
|
||||
|
||||
## 其它
|
||||
|
||||
* Docker 的 StackOverflow 问答主页:https://stackoverflow.com/search?q=docker
|
||||
@@ -1,168 +0,0 @@
|
||||
# Docker命令查询
|
||||
|
||||
##基本语法
|
||||
docker [OPTIONS] COMMAND [arg...]
|
||||
一般来说,Docker 命令可以用来管理 daemon,或者通过 CLI 命令管理镜像和容器。可以通过 `man docker` 来查看这些命令。
|
||||
|
||||
|
||||
##选项
|
||||
-D=true|false
|
||||
使用 debug 模式。默认为 false。
|
||||
|
||||
-H, --host=[unix:///var/run/docker.sock]: tcp://[host:port]来绑定或者 unix://[/path/to/socket] 来使用。
|
||||
在 daemon 模式下绑定的 socket,通过一个或多个 tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd 来指定。
|
||||
|
||||
--api-enable-cors=true|false
|
||||
在远端 API 中启用 CORS 头。缺省为 false。
|
||||
|
||||
-b=""
|
||||
将容器挂载到一个已存在的网桥上。指定为 'none' 时则禁用容器的网络。
|
||||
|
||||
--bip=""
|
||||
让动态创建的 docker0 采用给定的 CIDR 地址; 与 -b 选项互斥。
|
||||
|
||||
-d=true|false
|
||||
使用 daemon 模式。缺省为 false。
|
||||
|
||||
--dns=""
|
||||
让 Docker 使用给定的 DNS 服务器。
|
||||
|
||||
-g=""
|
||||
指定 Docker 运行时的 root 路径。缺省为 /var/lib/docker。
|
||||
|
||||
--icc=true|false
|
||||
启用容器间通信。默认为 true。
|
||||
|
||||
--ip=""
|
||||
绑定端口时候的默认 IP 地址。缺省为 0.0.0.0。
|
||||
|
||||
--iptables=true|false
|
||||
禁止 Docker 添加 iptables 规则。缺省为 true。
|
||||
|
||||
--mtu=VALUE
|
||||
指定容器网络的 mtu。缺省为 1500。
|
||||
|
||||
-p=""
|
||||
指定 daemon 的 PID 文件路径。缺省为 /var/run/docker.pid。
|
||||
|
||||
-s=""
|
||||
强制 Docker 运行时使用给定的存储驱动。
|
||||
|
||||
-v=true|false
|
||||
输出版本信息并退出。缺省值为 false。
|
||||
|
||||
--selinux-enabled=true|false
|
||||
启用 SELinux 支持。缺省值为 false。SELinux 目前不支持 BTRFS 存储驱动。
|
||||
|
||||
|
||||
##命令
|
||||
Docker 的命令可以采用 `docker-CMD` 或者 `docker CMD` 的方式执行。两者一致。
|
||||
|
||||
docker-attach(1)
|
||||
依附到一个正在运行的容器中。
|
||||
|
||||
docker-build(1)
|
||||
从一个 Dockerfile 创建一个镜像
|
||||
|
||||
docker-commit(1)
|
||||
从一个容器的修改中创建一个新的镜像
|
||||
|
||||
docker-cp(1)
|
||||
从容器中复制文件到宿主系统中
|
||||
|
||||
docker-diff(1)
|
||||
检查一个容器文件系统的修改
|
||||
|
||||
docker-events(1)
|
||||
从服务端获取实时的事件
|
||||
|
||||
docker-export(1)
|
||||
导出容器内容为一个 tar 包
|
||||
|
||||
docker-history(1)
|
||||
显示一个镜像的历史
|
||||
|
||||
docker-images(1)
|
||||
列出存在的镜像
|
||||
|
||||
docker-import(1)
|
||||
导入一个文件(典型为 tar 包)路径或目录来创建一个镜像
|
||||
|
||||
docker-info(1)
|
||||
显示一些相关的系统信息
|
||||
|
||||
docker-inspect(1)
|
||||
显示一个容器的底层具体信息。
|
||||
|
||||
docker-kill(1)
|
||||
关闭一个运行中的容器 (包括进程和所有资源)
|
||||
|
||||
docker-load(1)
|
||||
从一个 tar 包中加载一个镜像
|
||||
|
||||
docker-login(1)
|
||||
注册或登录到一个 Docker 的仓库服务器
|
||||
|
||||
docker-logout(1)
|
||||
从 Docker 的仓库服务器登出
|
||||
|
||||
docker-logs(1)
|
||||
获取容器的 log 信息
|
||||
|
||||
docker-pause(1)
|
||||
暂停一个容器中的所有进程
|
||||
|
||||
docker-port(1)
|
||||
查找一个 nat 到一个私有网口的公共口
|
||||
|
||||
docker-ps(1)
|
||||
列出容器
|
||||
|
||||
docker-pull(1)
|
||||
从一个Docker的仓库服务器下拉一个镜像或仓库
|
||||
|
||||
docker-push(1)
|
||||
将一个镜像或者仓库推送到一个 Docker 的注册服务器
|
||||
|
||||
docker-restart(1)
|
||||
重启一个运行中的容器
|
||||
|
||||
docker-rm(1)
|
||||
删除给定的若干个容器
|
||||
|
||||
docker-rmi(1)
|
||||
删除给定的若干个镜像
|
||||
|
||||
docker-run(1)
|
||||
创建一个新容器,并在其中运行给定命令
|
||||
|
||||
docker-save(1)
|
||||
保存一个镜像为 tar 包文件
|
||||
|
||||
docker-search(1)
|
||||
在 Docker index 中搜索一个镜像
|
||||
|
||||
docker-start(1)
|
||||
启动一个容器
|
||||
|
||||
docker-stop(1)
|
||||
终止一个运行中的容器
|
||||
|
||||
docker-tag(1)
|
||||
为一个镜像打标签
|
||||
|
||||
docker-top(1)
|
||||
查看一个容器中的正在运行的进程信息
|
||||
|
||||
docker-unpause(1)
|
||||
将一个容器内所有的进程从暂停状态中恢复
|
||||
|
||||
docker-version(1)
|
||||
输出 Docker 的版本信息
|
||||
|
||||
docker-wait(1)
|
||||
阻塞直到一个容器终止,然后输出它的退出符
|
||||
|
||||
##一张图总结 Docker 的命令
|
||||
|
||||

|
||||
@@ -1,2 +0,0 @@
|
||||
# 常见仓库介绍
|
||||
本章将介绍常见的一些仓库和镜像的功能,使用方法和生成它们的 Dockerfile 等。包括 Ubuntu、CentOS、MySQL、MongoDB、Redis、Nginx、Wordpress、Node.js 等。
|
||||
@@ -1,17 +0,0 @@
|
||||
## [CentOS](https://registry.hub.docker.com/_/centos/)
|
||||
|
||||
### 基本信息
|
||||
[CentOS](https://en.wikipedia.org/wiki/CentOS) 是流行的 Linux 发行版,其软件包大多跟 RedHat 系列保持一致。
|
||||
该仓库提供了 CentOS 从 5 ~ 7 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
默认会启动一个最小化的 CentOS 环境。
|
||||
```
|
||||
$ sudo docker run --name some-centos -i -t centos bash
|
||||
bash-4.2#
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
* [CentOS 5 版本](https://github.com/CentOS/sig-cloud-instance-images/blob/2e5a9c4e8b7191b393822e4b9e98820db5638a77/docker/Dockerfile)
|
||||
* [CentOS 6 版本](https://github.com/CentOS/sig-cloud-instance-images/blob/8717e33ea5432ecb33d7ecefe8452a973715d037/docker/Dockerfile)
|
||||
* [CentOS 7 版本](https://github.com/CentOS/sig-cloud-instance-images/blob/af7a1b9f8f30744360a10fe44c53a1591bef26f9/docker/Dockerfile)
|
||||
@@ -1,26 +0,0 @@
|
||||
## [MongoDB](https://registry.hub.docker.com/_/mongo/)
|
||||
|
||||
### 基本信息
|
||||
[MongoDB](https://en.wikipedia.org/wiki/MongoDB) 是开源的 NoSQL 数据库实现。
|
||||
该仓库提供了 MongoDB 2.2 ~ 2.7 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
默认会在 `27017` 端口启动数据库。
|
||||
```
|
||||
$ sudo docker run --name some-mongo -d mongo
|
||||
```
|
||||
|
||||
使用其他应用连接到容器,可以用
|
||||
```
|
||||
$ sudo docker run --name some-app --link some-mongo:mongo -d application-that-uses-mongo
|
||||
```
|
||||
或者通过 `mongo`
|
||||
```
|
||||
$ sudo docker run -it --link some-mongo:mongo --rm mongo sh -c 'exec mongo "$MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT/test"'
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
* [2.2 版本](https://github.com/docker-library/mongo/blob/77c841472ccb6cc87fea1218269d097405edc6cb/2.2/Dockerfile)
|
||||
* [2.4 版本](https://github.com/docker-library/mongo/blob/807078cb7b5f0289f6dabf9f6875d5318122bc30/2.4/Dockerfile)
|
||||
* [2.6 版本](https://github.com/docker-library/mongo/blob/77c841472ccb6cc87fea1218269d097405edc6cb/2.6/Dockerfile)
|
||||
* [2.7 版本](https://github.com/docker-library/mongo/blob/807078cb7b5f0289f6dabf9f6875d5318122bc30/2.7/Dockerfile)
|
||||
@@ -1,23 +0,0 @@
|
||||
## [MySQL](https://registry.hub.docker.com/_/mysql/)
|
||||
|
||||
### 基本信息
|
||||
[MySQL](https://en.wikipedia.org/wiki/MySQL) 是开源的关系数据库实现。
|
||||
该仓库提供了 MySQL 各个版本的镜像,包括 5.6 系列、5.7 系列等。
|
||||
|
||||
### 使用方法
|
||||
默认会在 `3306` 端口启动数据库。
|
||||
```
|
||||
$ sudo docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql
|
||||
```
|
||||
之后就可以使用其它应用来连接到该容器。
|
||||
```
|
||||
$ sudo docker run --name some-app --link some-mysql:mysql -d application-that-uses-mysql
|
||||
```
|
||||
或者通过 `mysql`。
|
||||
```
|
||||
$ sudo docker run -it --link some-mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
* [5.6 版本](https://github.com/docker-library/mysql/blob/7461a52b43f06839a4d8723ae8841f4cb616b3d0/5.6/Dockerfile)
|
||||
* [5.7 版本](https://github.com/docker-library/mysql/blob/7461a52b43f06839a4d8723ae8841f4cb616b3d0/5.7/Dockerfile)
|
||||
@@ -1,28 +0,0 @@
|
||||
## [Node.js](https://registry.hub.docker.com/_/node/)
|
||||
|
||||
### 基本信息
|
||||
[Node.js](https://en.wikipedia.org/wiki/Node.js)是基于 JavaScript 的可扩展服务端和网络软件开发平台。
|
||||
该仓库提供了 Node.js 0.8 ~ 0.11 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
在项目中创建一个 Dockerfile。
|
||||
```
|
||||
FROM node:0.10-onbuild
|
||||
# replace this with your application's default port
|
||||
EXPOSE 8888
|
||||
```
|
||||
然后创建镜像,并启动容器
|
||||
```
|
||||
$ sudo docker build -t my-nodejs-app
|
||||
$ sudo docker run -it --rm --name my-running-app my-nodejs-app
|
||||
```
|
||||
|
||||
也可以直接运行一个简单容器。
|
||||
```
|
||||
$ sudo docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
* [0.8 版本](https://github.com/docker-library/node/blob/d017d679e92e84a810c580cdb29fcdbba23c2bb9/0.8/Dockerfile)
|
||||
* [0.10 版本](https://github.com/docker-library/node/blob/913a225f2fda34d6a811fac1466e4f09f075fcf6/0.10/Dockerfile)
|
||||
* [0.11 版本](https://github.com/docker-library/node/blob/d017d679e92e84a810c580cdb29fcdbba23c2bb9/0.11/Dockerfile)
|
||||
@@ -1,29 +0,0 @@
|
||||
## [Redis](https://registry.hub.docker.com/_/redis/)
|
||||
|
||||
### 基本信息
|
||||
[Redis](https://en.wikipedia.org/wiki/Redis) 是开源的内存 Key-Value 数据库实现。
|
||||
该仓库提供了 Redis 2.6 ~ 2.8.9 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
默认会在 `6379` 端口启动数据库。
|
||||
```
|
||||
$ sudo docker run --name some-redis -d redis
|
||||
```
|
||||
另外还可以启用 [持久存储](http://redis.io/topics/persistence)。
|
||||
```
|
||||
$ sudo docker run --name some-redis -d redis redis-server --appendonly yes
|
||||
```
|
||||
默认数据存储位置在 `VOLUME/data`。可以使用 `--volumes-from some-volume-container` 或 `-v /docker/host/dir:/data` 将数据存放到本地。
|
||||
|
||||
使用其他应用连接到容器,可以用
|
||||
```
|
||||
$ sudo docker run --name some-app --link some-redis:redis -d application-that-uses-redis
|
||||
```
|
||||
或者通过 `redis-cli`
|
||||
```
|
||||
$ sudo docker run -it --link some-redis:redis --rm redis sh -c 'exec redis-cli -h "$REDIS_PORT_6379_TCP_ADDR" -p "$REDIS_PORT_6379_TCP_PORT"'
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
* [2.6 版本](https://github.com/docker-library/redis/blob/02d9cd887a4e0d50db4bb085eab7235115a6fe4a/2.6.17/Dockerfile)
|
||||
* [最新 2.8 版本](https://github.com/docker-library/redis/blob/d0665bb1bbddd4cc035dbc1fc774695fa534d648/2.8.13/Dockerfile)
|
||||
@@ -1,17 +0,0 @@
|
||||
## [Ubuntu](https://registry.hub.docker.com/_/ubuntu/)
|
||||
|
||||
### 基本信息
|
||||
[Ubuntu](https://en.wikipedia.org/wiki/Ubuntu) 是流行的 Linux 发行版,其自带软件版本往往较新一些。
|
||||
该仓库提供了 Ubuntu从12.04 ~ 14.10 各个版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
默认会启动一个最小化的 Ubuntu 环境。
|
||||
```
|
||||
$ sudo docker run --name some-ubuntu -i -t ubuntu
|
||||
root@523c70904d54:/#
|
||||
```
|
||||
|
||||
### Dockerfile
|
||||
* [12.04 版本](https://github.com/tianon/docker-brew-ubuntu-core/blob/2b105575647a7e2030ff344d427c3920b89e17a9/precise/Dockerfile)
|
||||
* [14.04 版本](https://github.com/tianon/docker-brew-ubuntu-core/blob/2b105575647a7e2030ff344d427c3920b89e17a9/trusty/Dockerfile)
|
||||
* [14.10 版本](https://github.com/tianon/docker-brew-ubuntu-core/blob/2b105575647a7e2030ff344d427c3920b89e17a9/utopic/Dockerfile)
|
||||
@@ -1,19 +0,0 @@
|
||||
## [WordPress](https://registry.hub.docker.com/_/wordpress/)
|
||||
|
||||
### 基本信息
|
||||
[WordPress](https://en.wikipedia.org/wiki/WordPress) 是开源的 Blog 和内容管理系统框架,它基于 PhP 和 MySQL。
|
||||
该仓库提供了 WordPress 4.0 版本的镜像。
|
||||
|
||||
### 使用方法
|
||||
启动容器需要 MySQL 的支持,默认端口为 `80`。
|
||||
```
|
||||
$ sudo docker run --name some-wordpress --link some-mysql:mysql -d wordpress
|
||||
```
|
||||
启动 WordPress 容器时可以指定的一些环境参数包括
|
||||
* `-e WORDPRESS_DB_USER=...` 缺省为 “root”
|
||||
* `-e WORDPRESS_DB_PASSWORD=...` 缺省为连接 mysql 容器的环境变量 `MYSQL_ROOT_PASSWORD` 的值
|
||||
* `-e WORDPRESS_DB_NAME=...` 缺省为 “wordpress”
|
||||
* `-e WORDPRESS_AUTH_KEY=...`, `-e WORDPRESS_SECURE_AUTH_KEY=...`, `-e WORDPRESS_LOGGED_IN_KEY=...`, `-e WORDPRESS_NONCE_KEY=...`, `-e WORDPRESS_AUTH_SALT=...`, `-e WORDPRESS_SECURE_AUTH_SALT=...`, `-e WORDPRESS_LOGGED_IN_SALT=...`, `-e WORDPRESS_NONCE_SALT=...` 缺省为随机 sha1 串
|
||||
|
||||
### Dockerfile
|
||||
* [4.0 版本](https://github.com/docker-library/wordpress/blob/aee00669e7c43f435f021cb02871bffd63d5677a/Dockerfile)
|
||||
@@ -1,7 +0,0 @@
|
||||
# 资源链接
|
||||
* Docker 主站点: https://www.docker.io
|
||||
* Docker 注册中心API: http://docs.docker.com/reference/api/registry_api/
|
||||
* Docker Hub API: http://docs.docker.com/reference/api/docker-io_api/
|
||||
* Docker 远端应用API: http://docs.docker.com/reference/api/docker_remote_api/
|
||||
* Dockerfile 参考:https://docs.docker.com/reference/builder/
|
||||
* Dockerfile 最佳实践:https://docs.docker.com/articles/dockerfile_best-practices/
|
||||
@@ -1,8 +1,7 @@
|
||||
# 基本概念
|
||||
Docker 包括三个基本概念
|
||||
* 镜像(Image)
|
||||
* 容器(Container)
|
||||
* 仓库(Repository)
|
||||
|
||||
理解了这三个概念,就理解了 Docker 的整个生命周期。
|
||||
# Basic Concepts
|
||||
Docker contains 3 basic concepts
|
||||
* `Image`
|
||||
* `Container`
|
||||
* `Repository`
|
||||
|
||||
Only after knowing the above 3 concepts will we get a deeper understanding of the lifecyle of docker.
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
## Docker 容器
|
||||
Docker 利用容器来运行应用。
|
||||
## Docker Container
|
||||
|
||||
容器是从镜像创建的运行实例。它可以被启动、开始、停止、删除。每个容器都是相互隔离的、保证安全的平台。
|
||||
The relationship between `Image` and `Container` is just as `Class` and `Instance` in [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming). `Image` is the static definition of `container`, while `containers` are the `images` in running state. `Containers` can be created, started, paused, deleted or stopped.
|
||||
|
||||
可以把容器看做是一个简易版的 Linux 环境(包括root用户权限、进程空间、用户空间和网络空间等)和运行在其中的应用程序。
|
||||
The essence of `container` is `process`, but different from that in the host OS, the container processes run in their individual [`namespaces`](https://en.wikipedia.org/wiki/Linux_namespaces). With the namespace, a container can have its own `root` filesystem, network configurations, process space and even an ID space for users. The processes in a container run in an isolated environment, thus can be used as if it were an individual OS independent of the host OS. This feature makes docker-encapsulated applications safer than those running directly on the host. And that's also an important factor that confuses the novices to tell it from virtual machines.
|
||||
|
||||
*注:镜像是只读的,容器在启动的时候创建一层可写层作为最上层。
|
||||
As we've discussed, `multi-layered filesystem` is applied to images, and so as the containers. When a container is running, it is based on its image, with a writable layer created on top of it. We call this layer prepared for R/W at runtime [**`Container Layer`**](https://docs.docker.com/storage/storagedriver/#images-and-layers).
|
||||
|
||||
The lifecyle of the container layer is the same as contaier. The container layer dies as soon as the container dies. Therefore, anything stored at the container layer will be discarded when the container is deleted.
|
||||
|
||||
As recommended by the [Docker Development Best Practices](https://docs.docker.com/develop/dev-best-practices/#where-and-how-to-persist-application-data), we should not write any data to the container layer to make it stateless. All file write operations should adhere to [`Volume`](../data_management/volume.md) or bind mounts. Writing to volume or bind mounts skips the container layer and R/W to host storage(or network storage) directly, which achieves better performance and stability.
|
||||
|
||||
The lifecyle of volume is independent of the container, and will not vanish when the container is deleted. In light of it, the data persists when a container is deleted or restarted.
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
## Docker 镜像
|
||||
Docker 镜像就是一个只读的模板。
|
||||
## Docker Image
|
||||
|
||||
例如:一个镜像可以包含一个完整的 ubuntu 操作系统环境,里面仅安装了 Apache 或用户需要的其它应用程序。
|
||||
As we all know, Operating System consists of kernel space and user space. For linux, it will mount `root` filesystem to support user space. For Docker Image, it is similar to a `root` filesystem in Linux. For example, the offical image `ubuntu:18:04` contains a micro `root` filesystem of complete opreating system.
|
||||
|
||||
镜像可以用来创建 Docker 容器。
|
||||
Docker Image is a special filesystem. Apart from programs, libs, resources and config which support running container, Docker Image also includes config parameters like anonymous volumes, environment variables, users and others. Images don't have any dynamic data. Its content will not be changed after build.
|
||||
|
||||
Docker 提供了一个很简单的机制来创建镜像或者更新现有的镜像,用户甚至可以直接从其他人那里下载一个已经做好的镜像来直接使用。
|
||||
## Advanced Multi-layered Unification Filesystem (AUFS)
|
||||
|
||||
Because the image contains the complete `root` file system of the operating system, its volume is often huge. So Docker made full use of [Union FS](https://en.wikipedia.org/wiki/Union_mount) and was designed as AUFS when it was designed. So strictly speaking, image is not a packaged file like an ISO image file. Image is just a virtual concept. It is not composed of a single file, but a group of file systems, or a combination of multi-layered filesystems.
|
||||
|
||||
When building an image, it builds layer by layer, and the former is the basis for the latter. Once each layer is built, it will not change later. Any change on the latter layer will only occur on its own level. For example, deleting the previous layer of files is not really deleting the files, but only marked as deleted in the current layer. When the final container runs, you won't see the file, but in fact the file will always follow the image. Therefore, take more care when building the image, and any redundant file should be cleared up in ahead of the layer's final construction.
|
||||
|
||||
The layered storage feature also makes it easier to reuse and customize images. You can even use a previously built image as the base layer, and then add a new layer to customize the content to meet your need to build a new image.
|
||||
|
||||
As for image building, further explanations will be given in subsequent relevant chapters.
|
||||
|
||||
@@ -1,14 +1,29 @@
|
||||
## Docker 仓库
|
||||
## Docker Registry
|
||||
|
||||
仓库是集中存放镜像文件的场所。有时候会把仓库和仓库注册服务器(Registry)混为一谈,并不严格区分。实际上,仓库注册服务器上往往存放着多个仓库,每个仓库中又包含了多个镜像,每个镜像有不同的标签(tag)。
|
||||
After the construction of an image, we can easily run it on a host. However, if we want to use the image on other servers, we need a centralized image storage and distribution service. The [Docker Registry](../repository/registry.md) we will introduce is such a service.
|
||||
|
||||
仓库分为公开仓库(Public)和私有仓库(Private)两种形式。
|
||||
A **Docker Registry** can contain several `Repositories`, where each repository can contain several tags and each tag corresponds to an image.
|
||||
|
||||
最大的公开仓库是 [Docker Hub](https://hub.docker.com),存放了数量庞大的镜像供用户下载。
|
||||
国内的公开仓库包括 [Docker Pool](http://www.dockerpool.com) 等,可以提供大陆用户更稳定快速的访问。
|
||||
Typically, a repository contains images for different versions of the same software, where each tags corresponds to different versions of the software. We can uniquely identify an image of the same software with `repository:tag`. In case not explicitly specified, `latest` is taken as default tag.
|
||||
|
||||
当然,用户也可以在本地网络内创建一个私有仓库。
|
||||
Taking the [Ubuntu Image](https://hub.docker.com/_/ubuntu) as an example. `ubuntu` is the name for repository, and inside it are tags for different versions, for instance, `16.04`, `18.04`. We can use `ubuntu:16.04` or `ubuntu:18.04` to specify the particular image we want. If the tag is omitted, for example, `ubuntu`, then it will be considered as `ubuntu:latest`.
|
||||
|
||||
当用户创建了自己的镜像之后就可以使用 `push` 命令将它上传到公有或者私有仓库,这样下次在另外一台机器上使用这个镜像时候,只需要从仓库上 `pull` 下来就可以了。
|
||||
Repository name is typically seperated by a forward slash(/), for example, `jwilder/nginx-proxy`, the former is to identify a particular user in a multi-user Docker Registry, while the latter corresponds to the software name. But it is not always the case. It also depends on the Docker Registry software or service you are using.
|
||||
|
||||
*注:Docker 仓库的概念跟 [Git](http://git-scm.com) 类似,注册服务器可以理解为 GitHub 这样的托管服务。
|
||||
### Docker Registry Public Services
|
||||
|
||||
`Docker Registry Public Services` are registry services open to users, allowing users to manage their images. Typically, those public services offer user free image uploads and downloads, and possibly provide charged service for privately managed images.
|
||||
|
||||
The most commonly used registry public service is the official [Docker Hub](https://hub.docker.com/), which is the default registry with thousands of high quality official images. Besides, the images for [Quay.io](https://quay.io/repository/) and CoreOS of [CoreOS](https://coreos.com/) are stored there. Google's [Google Container Registry](https://cloud.google.com/container-registry/) and [Kubernetes](https://kubernetes.io/) also use this service.
|
||||
|
||||
Due to some reasons knwon to all, accessing those services from China mainland is slow. There are some cloud service providers in China providing `Registry Mirror` for Docker Hub, those mirror services are called `accelerators`. The well-known ones are [Ali Cloud Image Accelerator](https://cr.console.aliyun.com/#/accelerator) and [DaoCloud Accelerator](https://www.daocloud.io/mirror#accelerator-doc). In China, downloading from these services are much faster than from Docker Hub. The detailed image source configuration tutorial is in the [Docker Installation](../install/mirror.md) section.
|
||||
|
||||
There are also some cloud service providers that provide public services similar to Docker Hub in China. For example, [Tenxcloud Mirror Registry](https://hub.tenxcloud.com/), [NetEase Mirror Registry](https://c.163.com/hub#/m/library/), [DaoCloud Mirror Market](https://hub.daocloud.io/), [Ali Cloud Mirror Registry](https://cr.console.aliyun.com), etc.
|
||||
|
||||
### Private Docker Registry
|
||||
|
||||
Apart from using public service, a user can set up private Docker Registry. Docker offical offers the [Docker Registry](https://hub.docker.com/_/registry/) docker image, which can be deployed for private registry service. We will explain how to set it up in detail in the [Private Registry](../repository/registry.md) section.
|
||||
|
||||
The open source Docker Registry image only provides the backend of [Docker Registry API](https://docs.docker.com/registry/spec/api/), which supports the `docker` commands and is enough for personal use, although the advanced functionalities like GUI(Graphical User Interface), Image Maintenance and Access Control are not supported. However, they are provided in the commercial version - [Docker Trusted Registry](https://docs.docker.com/datacenter/dtr/2.0/).
|
||||
|
||||
Except for the official Docker Registry, there are third-party softwares that implement Docker Registry API, even with some advanced features like user interface. For example, [Harbor](https://github.com/goharbor/harbor) and [Sonatype Nexus](../repository/nexus3_registry.md).
|
||||
|
||||
37
book.json
@@ -1 +1,36 @@
|
||||
{}
|
||||
{
|
||||
"title": "Docker Practice",
|
||||
"author": "yeasy",
|
||||
"language": "en",
|
||||
"links": {
|
||||
"sidebar": {
|
||||
"GitHub": "https://github.com/yeasy/docker_practice"
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"-livereload",
|
||||
"image-captions",
|
||||
"github",
|
||||
"page-treeview@2.9.8",
|
||||
"editlink"
|
||||
],
|
||||
"pluginsConfig": {
|
||||
"image-captions": {
|
||||
"attributes": {
|
||||
"width": "600"
|
||||
},
|
||||
"caption": "Image _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_"
|
||||
},
|
||||
"github": {
|
||||
"url": "https://github.com/yeasy/docker_practice"
|
||||
},
|
||||
"editlink": {
|
||||
"base": "https://github.com/yeasy/docker_practice/blob/english/"
|
||||
},
|
||||
"page-treeview": {
|
||||
"copyright": "Copyright © yeasy",
|
||||
"minHeaderCount": "2",
|
||||
"minHeaderDeep": "2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
cases/.image/drone-build.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
@@ -1,2 +0,0 @@
|
||||
#实战案例
|
||||
介绍一些典型的应用场景和案例。
|
||||
7
cases/ci/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# CI/CD
|
||||
|
||||
持续集成(Continuous integration)是一种软件开发实践,每次集成都通过自动化的构建(包括编译,发布,自动化测试)来验证,从而尽早地发现集成错误。
|
||||
|
||||
持续部署(continuous deployment)是通过自动化的构建、测试和部署循环来快速交付高质量的产品。
|
||||
|
||||
与 `Jenkins` 不同的是,基于 Docker 的 CI/CD 每一步都运行在 Docker 镜像中,所以理论上支持所有的编程语言。
|
||||
28
cases/ci/actions/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# GitHub Actions
|
||||
|
||||
GitGub Actions 是 GitHub 推出的一款 CI/CD 工具。
|
||||
|
||||
我们可以在每个 job 的 step 中使用 Docker 执行构建步骤。
|
||||
|
||||
```yaml
|
||||
on: push
|
||||
|
||||
name: CI
|
||||
|
||||
jobs:
|
||||
my-job:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- name: run docker container
|
||||
uses: docker://golang:alpine
|
||||
with:
|
||||
args: go version
|
||||
```
|
||||
|
||||
## 参考资料
|
||||
|
||||
* [Actions Docs](https://help.github.com/en/categories/automating-your-workflow-with-github-actions)
|
||||
6
cases/ci/drone/.env.example
Normal file
@@ -0,0 +1,6 @@
|
||||
DRONE_SERVER_HOST=
|
||||
DRONE_SERVER_PROTO=
|
||||
DRONE_RPC_SECRET=
|
||||
HOSTNAME=
|
||||
DRONE_GITHUB_CLIENT_ID=
|
||||
DRONE_GITHUB_CLIENT_SECRET=
|
||||