青岛中企动力做网站怎么样,一元钱购买网站空间,系统管理网站,交换链接营销的成功案例一、docker基本命令和操作
1. docker login【登录】
登录 docker client#xff0c;登录成功之后会显示 Login Succeeded。 docker login登陆到指定的镜像仓库#xff0c;docker pull 和 docker push 操作都需要预先执行 docker login 操作#xff1b; 指令#xff1a;登录成功之后会显示 Login Succeeded。 docker login登陆到指定的镜像仓库docker pull 和 docker push 操作都需要预先执行 docker login 操作 指令这里的用户名、密码和镜像仓库都换成自己的
docker login -u username -p password iregistry.baidu-int.com举例说明
➜ ~ docker login -u yangxiaonan01 -p Xxxxxxx123 iregistry.baidu-int.com WARNING! Using --password via the CLI is insecure. Use --password-stdin.Login Succeeded2.docker pull【拉取】
指令
docker pull iregistry.baidu-int.com/namespace/IMAGE[:TAG]举例说明
➜ ~ docker pull iregistry.baidu-int.com/xk-repo-test/centos-test:1.0.11.0.1: Pulling from xk-repo-test/centos-test8a29a15cefae: Pull complete Digest: sha256:9e0c275e0bcb495773b10a18e499985d782810e47b4fce076422acb4bc3da3ddStatus: Downloaded newer image for iregistry.baidu-int.com/xk-repo-test/centos-test:1.0.1iregistry.baidu-int.com/xk-repo-test/centos-test:1.0.13.docker save【保存】
指令
docker save -o 景象名.tar 镜像地址该指令会将镜像保存在本地执行命令的目录上
4.docker build【构建】
指令
docker build -f dockerFile -t iregistry.baidu-int.com/namespace/IMAGE[:TAG] contextPath注意
dockerFile一个用来构建镜像的文本文件
namespace命名空间。一个组织维度包含多个镜像仓库和chartIMAGE镜像名称TAG镜像标签contextPath指定构建镜像的上下文的路径构建镜像的过程中可以且只可以引用上下文中的任何文件
举例说明
➜ ~ vi ~/Desktop/work/DockerFile/dockerfile-nginx ➜ ~ cat ~/Desktop/work/DockerFile/dockerfile-nginx
FROM iregistry.baidu-int.com/yxn-test/nginx:latest
MAINTAINER yxnyangxiaonan01baidu.com➜ ~ docker build -f ~/Desktop/work/DockerFile/dockerfile-nginx -t iregistry.baidu-int.com/yxn-test/nginx:v1.0 .➜ ~ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
iregistry.baidu-int.com/yxn-test/nginx v1.0 1a6c19b45d6e 2 days ago 133MB5.docker push【推送】
指令
docker push iregistry.baidu-int.com//IMAGE[:TAG]
注意
namespace命名空间。一个组织维度包含多个镜像仓库和chartIMAGE镜像名称TAG镜像标签
举例说明 ➜ ~ docker push iregistry.baidu-int.com/yxn-test/centos-test:1.0.1 The push refers to repository [iregistry.baidu-int.com/yxn-test/mysql]03a007e88ba3: Pushed d605c112cfab: Pushed 74634a9cf30b: Pushed ea5fd90d1e58: Pushed cffd1f984514: Pushed 3182d4b853f0: Pushed ae477702a513: Pushed 570df12e998c: Pushed b2abc2ad4a41: Pushed e82f328cb5e6: Pushed 14be0d40572c: Pushed 02c055ef67f5: Pushed latest: digest: sha256:68b207d01891915410db3b5bc1f69963e3dc8f23813fd01e61e6d7e7e3a46680 size: 28286.docker tag【打标签】
指令
docker tag SOURCE_IMAGE[:TAG] iregistry.baidu-int.com/namespace/IMAGE[:TAG]注意
namespace命名空间。一个组织维度包含多个镜像仓库和chartIMAGE镜像名称TAG镜像标签
举例说明 docker tag iregistry.baidu-int.com/xk-repo-test/centos-test:1.0.1 iregistry.baidu-int.com/yxn-test/centos-test:1.0.2二、Chart的基本命令和操作
1. helm安装与配置 参考文档https://helm.sh/docs/intro/install/
2. 添加仓库 简介根据iRegistry仓库的用户名、密码在本地添加chart repo【注意添加一次即可】
指令 helm repo add --username --password https://iregistry.baidu-int.com/chartrepo/
注意 namespace命名空间。一个组织维度包含多个镜像仓库和chart
指令执行结果举例说明
➜ ~ helm repo add --username yangxiaonan01 --password Yangxiaonan01 yxn-test https://iregistry.baidu-int.com/chartrepo/yxn-test
yxn-test has been added to your repositories
➜ ~ helm repo list
NAME URL
yxn-test https://iregistry.baidu-int.com/chartrepo/yxn-test3.下载 Chart 简介从chart仓库中下载指定版本的chart到本地
第一步配置 helm fetch 时使用的密码详见【Helm Chart基本操作 -- 前提】若已经配置过则跳过
第二步本地添加仓库详见【Helm Chart基本操作 -- 添加仓库】若已经添加过则跳过 指令 helm fetch --version Chart 版本 本地仓库名称/Chart 名称
指令执行结果举例说明
➜ ~ helm fetch --version 0.1.0-145583081-1609409229920 yxn-test/helm2-demo4.上传 Chart
简介将本地中存在的chart文件上传到iRegistry镜像仓库中
第一步配置helm push的密码详见【Helm Chart基本操作 -- 前提】若已经配置过则跳过
第二步安装 helm push 插件参考链接helm push插件安装
第三步本地添加仓库详见【Helm Chart基本操作 -- 添加仓库】若已经添加过则跳过
第四步上传charthelm push
chart packagecharts文件包charts repocharts仓库名称 指令
➜ ~ helm plugin install https://github.com/chartmuseum/helm-push.git # 第二步安装helm push插件
Downloading and installing helm-push v0.9.0 ...
https://github.com/chartmuseum/helm-push/releases/download/v0.9.0/helm-push_0.9.0_darwin_amd64.tar.gz
Installed plugin: push ➜ ~ helm repo add --username yangxiaonan01 --password Xxxx1234 yxn-test https://iregistry.baidu-int.com/chartrepo/yxn-test # 第三步添加仓库
yxn-test has been added to your repositories➜ ~ helm repo list # 查看仓库列表
NAME URL
yxn-test https://iregistry.baidu-int.com/chartrepo/yxn-test ➜ ~ helm push ~/Downloads/sec-brain-web-0.0.1-162952076.tgz yxn-test # 第四步上传chart
Pushing sec-brain-web-0.0.1-162952076.tgz to yxn-test...
Done.5.安装 Chart 简介将某个chart版本部署到k8s集群中 第一步配置 helm install 时使用的密码详见【Helm Chart基本操作 -- 前提】若已经配置过则跳过 第二步本地添加仓库详见【Helm Chart基本操作 -- 添加仓库】若已经添加过则跳过 第三步执行helm install 指令 helm install --username --password --version Chart 版本 本地仓库名称/Chart 名称