docker 自学视频与资源百度网盘下载

下载地址:链接: https://pan.baidu.com/s/1lJbQOkfRw3NIZkUnUCkB_A 提取码: 8hv1

镜像制作:
基于容器制作
在容器中完成操作后制作;
基于镜像制作
编辑一个Dockerfile,而后根据此文件制作;
基于容器制作:
docker commit
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
–author, -a
–pause, -p
–message, -m
–change, -c
将镜像文件导出为tar文件:
docker save
Save one or more images to a tar archive (streamed to STDOUT by default)
docker save [OPTIONS] IMAGE [IMAGE…]
从tar文件导入镜像 :
docker load
Load an image from a tar archive or STDIN
docker load [OPTIONS]
–input, -i Read from tar archive file, instead of STDIN
–quiet, -q false Suppress the load output
Docker参考手册:
https://docs.docker.com/engine/reference/commandline/dockerd/

配置docker守护进程的属性信息的方法:/etc/docker/daemon.json
每一个可设置的键是dockerd的可用的选项,其值为选项的参数;但有些参数不可用于此文件中,例如add-registry,
insecure-registry;
有些选项的参数是数组的格式,需要放置于[];

官方手册(完整的可用参数列表):
https://docs.docker.com/engine/reference/commandline/dockerd/#run-multiple-daemons

{
“authorization-plugins”: [],
2018/8/23 Docker.txt
file:///C:/Users/Administrator/Desktop/Docker.txt
4
/14
“data-root”: “”,
“dns”: [],
“dns-opts”: [],
“dns-search”: [],
“exec-opts”: [],
“exec-root”: “”,
“experimental”: false,
“storage-driver”: “”,
“storage-opts”: [],
“labels”: [],
“live-restore”: true,
“log-driver”: “”,
“log-opts”: {},
“mtu”: 0,
“pidfile”: “”,
“cluster-store”: “”,
“cluster-store-opts”: {},
“cluster-advertise”: “”,
“max-concurrent-downloads”: 3,
“max-concurrent-uploads”: 5,
“default-shm-size”: “64M”,
“shutdown-timeout”: 15,
“debug”: true,
“hosts”: [],
“log-level”: “”,
“tls”: true,
“tlsverify”: true,
“tlscacert”: “”,
“tlscert”: “”,
“tlskey”: “”,
“swarm-default-advertise-addr”: “”,
“api-cors-header”: “”,
“selinux-enabled”: false,
“userns-remap”: “”,
“group”: “”,
“cgroup-parent”: “”,
“default-ulimits”: {},
“init”: false,
“init-path”: “/usr/libexec/docker-init”,
“ipv6”: false,
“iptables”: false,
“ip-forward”: false,
“ip-masq”: false,
“userland-proxy”: false,
“userland-proxy-path”: “/usr/libexec/docker-proxy”,
“ip”: “0.0.0.0”,
“bridge”: “”,
“bip”: “”,
“fixed-cidr”: “”,
“fixed-cidr-v6”: “”,
“default-gateway”: “”,
“default-gateway-v6”: “”,
“icc”: false,
“raw-logs”: false,
“allow-nondistributable-artifacts”: [],
“registry-mirrors”: [],
“seccomp-profile”: “”,
“insecure-registries”: [],
“disable-legacy-registry”: false,
“no-new-privileges”: false,
“default-runtime”: “runc”,
“oom-score-adjust”: -500,
“runtimes”: {
“runc”: {
“path”: “runc”
},
“custom”: {
“path”: “/usr/local/bin/my-runc-replacement”,
“runtimeArgs”: [
“–debug”
]
}
}
}
2018/8/23 Docker.txt
file:///C:/Users/Administrator/Desktop/Docker.txt 5/14

dockerd守护进程的C/S,其默认仅监听Unix SOcket格式的地址,/var/run/docker.sock;如果使用TCP套接字,
/etc/docker/daemon.json:
“hosts”: [“tcp://0.0.0.0:2375”, “unix:///var/run/docker.sock”]

也可向dockerd直接传递“-H|–host”选项;

自定义docker0桥的网络属性信息:/etc/docker/daemon.json文件
{
“bip”: “192.168.1.5/24”,
“fixed-cidr”: “10.20.0.0/16”,
“fixed-cidr-v6”: “2001:db8::/64”,
“mtu”: 1500,
“default-gateway”: “10.20.1.1”,
“default-gateway-v6”: “2001:db8:abcd::89”,
“dns”: [“10.20.1.2″,”10.20.1.3”]
}

核心选项为bip,即bridge ip之意,用于指定docker0桥自身的IP地址;其它选项可通过此地址计算得出。
文档路径:
https://docs.docker.com/engine/userguide/networking/default_network/custom-docker0/

容器构建示例:
https://github.com/mysql/mysql-docker

容器的资源限制:
CPU:
RAM:
Device:
–device-read-bps value Limit read rate (bytes per second) from a device (default [])
–device-read-iops value Limit read rate (IO per second) from a device (default [])
–device-write-bps value Limit write rate (bytes per second) to a device (default [])
–device-write-iops value Limit write rate (IO per second) to a device (default [])
Docker private Registry的Nginx反代配置方式:
client_max_body_size 0;
location / {
proxy_pass http://registrysrvs;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
auth_basic “Docker Registry Service”;
auth_basic_user_file “/etc/nginx/.ngxpasswd”;
}

Docker-distribution配置文件格式详细信息:
https://docs.docker.com/registry/configuration/#list-of-configuration-options

Kubernetes
架构:master/agent
master主机:
kube-apiserver
kube-scheduler
kube-controller-manager
agent主机(node):
kubelet
2018/8/23 Docker.txt
file:///C:/Users/Administrator/Desktop/Docker.txt 6/14
container runtime(docker/rkt/…)
kube-proxy
容器编排三套解决方案:
kubernetes
mesos+marathon
machine+swarn+compose

Kubernetes:
组件:master, nodes, database(k/v store)
master:apiserver, controller-manager, scheduler
nodes: kubelet, kube-proxy, container runtime
核心术语:
Pod, label, service, ingress
网络插件:flannel, …

Kubernetes-1.8安装:
yum 仓库:
https://yum.kubernetes.io/
https://packages.cloud.google.com/yum/rep

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注