--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]#