k8s第一天-docker安裝

安裝Base源

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安裝epel源

yum install epel-release -y

查看epel源下docker相關(guān)的包

yum list docker --show-duplicates

安裝docker-ce

yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce

配置daemon.json

vim /etc/docker/daemon.json

{
  "graph": "/data/docker",
  "storage-driver": "overlay2",
  "insecure-registries": ["registry.access.redhat.com", "quay.io"],
  "registry-mirrors": ["https://b7a2cowo.mirror.aliyuncs.com"],
  "exec-opts": ["native.cgroupdriver=systemd"],
  "live-restore": true,
  "bip": "172.7.5.1/24"
}

設(shè)置開機(jī)啟動(dòng)

systemctl enable docker
systemctl start docker

第一個(gè)docker程序

docker run hello-world
# 重要信息
To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

鏡像的結(jié)構(gòu)

${registry_name}/${repository_name}/${image_name}:${tag_name}
例如:
docker.io/library/alpine:3.10.1

docker鏡像倉庫

docker鏡像倉庫(kaili Jkl123456)
docker login docker.io

登錄信息的存放地址:cat /root/.docker/config.json
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容