DockerDocker基础入门
资源文件列表:

Docker基础入门.md 12.4KB
Docker基础入门.pdf 1.75MB
资源介绍:
本系列博客文章旨在为初学者提供一个全面而深入的 Docker 学习资源。旨在帮助初学者从零开始,一步步掌握 Docker 的核心技术和应用。资源包含了详细的操作指南和深入的技术解析,涵盖了从 Docker 安装、基础命令的使用,到容器的管理与操作,以及镜像的创建与分发等全方位的内容。 为了方便不同需求的读者,我们提供了两种格式的资源:Markdown 版本方便在 GitHub 或其他支持 Markdown 的编辑器中阅读和编辑,而 PDF 版本则适合打印或在移动设备上阅读。无论您是更喜欢在线阅读还是离线学习,都可以找到适合您的学习方式。 通过本系列文章,您将能够: 掌握 Docker 安装:了解如何在多种操作系统上安装和配置 Docker,为后续的学习打下坚实的基础。 具体操作:学习 Docker 日常使用中的基本命令和操作流程,包括容器的启动、停止和移除等。 Docker 命令:深入了解 Docker 的命令行工具,包括如何下载和管理镜像,以及如何监控和调试容器。 下载和启动容器:获取所需的镜像并启动容器,理解容器与镜像间的关系。 参数和命令详解:详细解释 Docker 命令的
2
0
)
移
除
旧
版
本
Docker
具
体
操
作
#
移
除
旧
版
本
docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
#
配
置
docker yum
源
。
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#
安
装
最
新
docker
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-pl
ugin docker-compose-plugin
#
启
动
&
开
机
启
动
docker
;
enable + start
⼆
合
⼀
systemctl enable docker --now
#
配
置
加
速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://82m9ar63.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Java

3
1
)
配
置
docker yum
源
(
安
装
⼯
具
类
,
配
置
地址
源
)
官
⽹
(
备
⽤
,不
太
推
荐
):
如
果
此步
在
安
装
过
程
中
如
下
图
报
错
:
●
●
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
1
2
3
4
5
6
7
8
Java
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
1
2
3
4
Java
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/cento
s/docker-ce.repo
1
2
Java

4
[root@localhost ~]# sudo yum install -y yum-utils
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch
=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org;
未
知的
错
误
"
One of the configured repositories failed (
未
知
),
and yum doesn't have enough cached data to continue. At this point the on
ly
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the pr
oblem.
2. Reconfigure the baseurl/etc. for the repository, to point to a wor
king
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by defaul
t. Yum
will then just ignore the repository until you permanently enable
it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailab
le.
Note that yum will try to contact the repo. when it runs most comm
ands,
so will have to try and fail each time (and thus. yum will be be m
uch
slower). If it is a very temporary problem though, this is often
a nice
compromise:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Java