kolla-build经常使用命令行详解

--base-image
用于指定使用本身定制的基础镜像,不用官方网站的
样例以下:kolla-build --base-image registry.access.redhat.com/rhel7/rhel --base rhel
--base BASE, -b BASE node

用于指定基础镜像的发布类型,可选的值为centos, rhel, ubuntu, oraclelinuxlinux

样例以下:kolla-build -b ubuntugit

--base-tag BASE_TAG
基础发布镜像的标签,从docker hub上拉取基础镜像的某个标签版本,默认自动拉取的是latest标签redis

样例以下:mongodb

[root@localhost tools]# kolla-build -b centos -t binary --base-tag 1.0.0 rally docker

INFO:kolla.image.build:Found the docker image folder at /usr/share/kolla/docker
INFO:kolla.image.build:Added image base to queue
INFO:kolla.image.build:Attempting to run task BuildTask(base) for the first time
INFO:kolla.image.build.base:Building
INFO:kolla.image.build.base:Step 1/46 : FROM centos:1.0.0
ubuntu


--cache
在制做镜像的时候,使用docker缓存,这个参数的好处是,当某一个镜像制做失败时,从新制做,会加快镜像制做速度
--debug, -d
打开debug开关
--namespace NAMESPACE, -n NAMESPACE
docker的命名空间,主要用于隔离容器swift

--nocache
不缓存镜像
--nodebug
取消debug开关
--profile PROFILE, -p PROFILE
指定要建立的镜像集合,这个镜像集合的值在kolla-build.conf的[profiles]中定义,默认的镜像集合有:infra,main, aux, default, gate
样例以下 kolla-build --profile magnumcentos

--template-only
不制做镜像,仅仅生成 Dockerfile文件
--template-override TEMPLATE_OVERRIDE
模板覆盖文件的路径,不清楚如何用
--threads THREADS, -T THREADS
制做镜像的时候,使用多少个线程
--version
显示kolla的版本
--type INSTALL_TYPE, -t INSTALL_TYPE
openstack的安装方式,容许的值为binary,source,rdo
样例以下 kolla-build -t source
当使用源码的时候,openstack源码的路径在kolla-build.conf中配置,
源码的类型支持url, git, local。local类型的有两种方式,一种是包含有源代码的目录,或者是源码压缩包的目录
样例以下:
[glance-base]
type = url
location = http://tarballs.openstack.org/glance/glance-master.tar.gz缓存

[keystone-base]
type = git
location = https://git.openstack.org/openstack/keystone
reference = stable/mitaka

[heat-base]
type = local
location = /home/kolla/src/heat

[ironic-base]
type = local
location = /tmp/ironic.tar.gz

--tag TAG             The Docker tag

镜像在docker里面的标签

样例以下:

kolla-build -b centos -t binary --tag 1.0.0 rally 

[root@localhost tools]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kolla/centos-binary-rally 1.0.0 aee18a82388b 28 seconds ago 682MB
kolla/centos-binary-nova-compute 1.0.0 66993a1beb69 3 hours ago 1.2GB

新增两个参数

--template-only Don't build images. Generate Dockerfile only----仅仅生成dockerfile文件
--template-override TEMPLATE_OVERRIDE Path to template override file----对要覆盖block的内容的编写

[root@localhost ~]# kolla-build -b centos --base-tag 7 --tag 2.0 --template-only --template-override /root/chen-template-overrides.j2 rabbitmq
INFO:kolla.image.build:Found the docker image folder at /usr/share/kolla/docker
INFO:kolla.image.build:Dockerfiles are generated in /tmp/kolla-2018-11-08_22-04-08_ZLzTGF/docker-----------在build镜像的时候,若是是生成镜像,那么会先生成dockerfile文件,再根据该dockerfile生成该镜像
[root@localhost ~]#

[root@localhost docker]# pwd/tmp/kolla-2018-11-08_22-04-08_ZLzTGF/docker[root@localhost docker]# lsaodh cinder dnsmasq grafana ironic kolla-toolbox manila murano rabbitmq swift vmtpbarbican cloudkitty elasticsearch haproxy iscsid kube mariadb neutron rally tacker watcherbase collectd etcd heat kafka kubernetes-entrypoint memcached nova redis telegraf zaqarbifrost congress fluentd heka karbor kubetoolbox mistral octavia sahara tempest zookeeperceilometer cron freezer helm-repository keepalived kuryr monasca openstack-base searchlight tgtd zunceph designate glance horizon keystone macros.j2 mongodb openvswitch senlin trovechrony dind gnocchi influxdb kibana magnum multipathd panko solum vitrage[root@localhost docker]#

相关文章
相关标签/搜索