This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(docker): 修改FAQ目录结构,解决因镜像源版本不匹配导致的git/g++安装失败问题
- Loading branch information
Showing
6 changed files
with
100 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
|
||
FAQ | ||
========================================= | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
faq/service启动docker失效 | ||
faq/docker build运行apt-get update失败 | ||
faq/安装git出错 | ||
faq/安装g++出错 |
49 changes: 1 addition & 48 deletions
49
docs/source/docker/FAQ.md → ...ker/faq/docker build运行apt-get update失败.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
# service启动docker失效 | ||
|
||
``` | ||
$ service docker start | ||
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. | ||
$ systemctl status docker.service | ||
● docker.service - Docker Application Container Engine | ||
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) | ||
Active: failed (Result: start-limit-hit) since 四 2019-09-19 16:16:09 CST; 6s ago | ||
Docs: https://docs.docker.com | ||
Process: 7950 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) | ||
Main PID: 7950 (code=exited, status=1/FAILURE) | ||
9月 19 16:16:07 zj-ThinkPad-T470p systemd[1]: Failed to start Docker Application Container Engine. | ||
9月 19 16:16:07 zj-ThinkPad-T470p systemd[1]: docker.service: Unit entered failed state. | ||
9月 19 16:16:07 zj-ThinkPad-T470p systemd[1]: docker.service: Failed with result 'exit-code'. | ||
9月 19 16:16:09 zj-ThinkPad-T470p systemd[1]: docker.service: Service hold-off time over, scheduling restart. | ||
9月 19 16:16:09 zj-ThinkPad-T470p systemd[1]: Stopped Docker Application Container Engine. | ||
9月 19 16:16:09 zj-ThinkPad-T470p systemd[1]: docker.service: Start request repeated too quickly. | ||
9月 19 16:16:09 zj-ThinkPad-T470p systemd[1]: Failed to start Docker Application Container Engine. | ||
9月 19 16:16:09 zj-ThinkPad-T470p systemd[1]: docker.service: Unit entered failed state. | ||
9月 19 16:16:09 zj-ThinkPad-T470p systemd[1]: docker.service: Failed with result 'start-limit-hit'. | ||
``` | ||
|
||
我的问题是`/etc/docker/daemon.json`配置出错 | ||
|
||
``` | ||
$ cat /etc/docker/daemon.json | ||
{ | ||
"mtu": 1450, | ||
"registry-mirrors": ["https://xxx.mirror.aliyuncs.com"], | ||
"dns": ["192.168.0.1", "8.8.8.8"] | ||
} | ||
``` | ||
|
||
去掉`dns`键值对后重新启动成功 | ||
|
||
``` | ||
$ sudo service docker start | ||
$ ps aux | grep docker | ||
root 8263 2.0 0.5 805596 82912 ? Ssl 16:19 0:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock | ||
zj 8468 0.0 0.0 15964 1016 pts/2 R+ 16:19 0:00 grep --color=auto docker | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
# 安装g++出错 | ||
|
||
参考: | ||
|
||
[Ubuntu18.04LTS安装g++错误以及解决方法](http://blog.sina.com.cn/s/blog_64bb0c990102yv3a.html) | ||
|
||
[安装g++出现的问题解决了一部分,还有一些。求大神指教](https://forum.ubuntu.org.cn/viewtopic.php?t=465488) | ||
|
||
使用`Docker`镜像`Ubuntu:18.04`,安装`g++`时出现错误 | ||
|
||
``` | ||
The following packages have unmet dependencies: | ||
g++ : Depends: g++-5 (>= 5.3.1-3~) but it is not going to be installed | ||
E: Unable to correct problems, you have held broken packages. | ||
``` | ||
|
||
网上查询时发现可能是系统镜像源设置出错,我使用了`Ubuntu 16.04`的阿里镜像。在[Mirrors](https://opsx.alibaba.com/mirror)中找到`Ubuntu 18.04`的镜像源配置 | ||
|
||
``` | ||
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse | ||
``` | ||
|
||
重新配置后,成功安装`g++` |
4 changes: 3 additions & 1 deletion
4
docs/source/docker/advanced/git安装.md → docs/source/docker/faq/安装git出错.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
|
||
# git安装 | ||
# 安装git出错 | ||
|
||
最新发现:是因为`Ubuntu`镜像源出错,我在`18.04`上误用了`16.04`的`ali mirror` | ||
|
||
## 问题 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ docker使用指南 | |
advanced | ||
gui | ||
|
||
FAQ | ||
faq | ||
|
||
参考 | ||
****** | ||
|