kolla-build常用命令行详解

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

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

样例如下:kolla-build -b ubuntu

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

样例如下:

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

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


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

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

--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]# ls
aodh cinder dnsmasq grafana ironic kolla-toolbox manila murano rabbitmq swift vmtp
barbican cloudkitty elasticsearch haproxy iscsid kube mariadb neutron rally tacker watcher
base collectd etcd heat kafka kubernetes-entrypoint memcached nova redis telegraf zaqar
bifrost congress fluentd heka karbor kubetoolbox mistral octavia sahara tempest zookeeper
ceilometer cron freezer helm-repository keepalived kuryr monasca openstack-base searchlight tgtd zun
ceph designate glance horizon keystone macros.j2 mongodb openvswitch senlin trove
chrony dind gnocchi influxdb kibana magnum multipathd panko solum vitrage
[root@localhost docker]#

原文地址:https://www.cnblogs.com/potato-chip/p/9561218.html