Skip to content
Snippets Groups Projects
Commit 0e8f20aa authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "update the image-building document"

parents 77d4449b 815fb844
No related branches found
No related tags found
No related merge requests found
Image building Image building
============== ==============
The ``tools/build-docker-image`` script in this repository is The ``tools/build.py`` script in this repository is
responsible for building docker images. It is symlinked as ``./build`` responsible for building docker images.
inside each Docker image directory.
When creating new image directories, you can run the Guide
``tools/update-build-links`` scripts to install the ``build`` symlink -----
(this script will install the symlink anywhere it find a file named
``Dockerfile``).
Workflow
--------
In general, you will build images like this: In general, you will build images like this:
:: ::
$ cd docker/keystone $ tools/build.py
$ ./build
By default, the above command would build all images based on centos image.
By default, the above command would build If you want to change the base distro image, add ``-b``:
``kollaglue/centos-rdo-keystone:CID``, where ``CID`` is the current
short commit ID. That is, given:
:: ::
$ git rev-parse HEAD $ tools/build.py -b ubuntu
76a16029006a2f5d3b79f1198d81acb6653110e9
There are following distros available for building images:
The above command would generate - fedora
``kollaglue/centos-rdo-keystone:76a1602``. This tagging is meant to - centos
prevent developers from stepping on each other or on release images - oraclelinux
during the development process. - ubuntu
To push the image after building, add ``--push``: To push the image after building, add ``--push``:
:: ::
$ ./build --push $ tools/build.py --push
To use these images, you must specify the tag in your ``docker run``
commands: If you want to build only keystone image, use the following command:
:: ::
$ docker run kollaglue/centos-rdo-keystone:76a1602 $ tools/build.py keystone
Building releases
-----------------
To build into the ``latest`` tag, add ``--release``: If you want to build multiple images e.g. keystone and nova, use the following command:
:: ::
$ ./build --release $ tools/build.py keystone nova
Or to build and push:
::
$ ./build --push --release ``tools/build.py`` use ``kollaglue`` as default namespace. If you
want to push images to your dockerhub, change the namespace like:
Build all images at once ::
------------------------
The ``build-all-docker-images`` script in the tools directory is a $ tools/build.py -n yourusername --push
wrapper for the ``build-docker-image`` that builds all images, as the
name suggests, in the correct order. It responds to the same options as
``build-docker-image`` with the additional ``--from`` and ``--to``
options that allows building only images that have changed between the
specified git revisions.
For example, to build all images contained in docker directory and push
new release:
:: Build Openstack from Source
---------------------------
$ tools/build-all-docker-images --release --push When building images, there are two methods of the Openstack install.
One is ``binary``. Another is ``source``.
To build only images modified in test-branch along with their children: The ``binary`` means that Openstack will be installed from apt/yum.
And the ``source`` means that Openstack will be installed from source code.
The default method of the Openstack install is ``binary``.
You can change it to ``source`` using the following command:
:: ::
$ tools/build-all-docker-images --from master --to test-branch tools/build.py -t source
Configuration
-------------
The ``build-docker-image`` script will look for a file named The locations of Opentack source code are written in ``build.ini``.
``.buildconf`` in the image directory and in the top level of the Now the source type support ``url`` and ``git``. The ``build.ini`` looks like:
repository. You can use this to set defaults, such as:
:: ::
NAMESPACE=larsks [glance-base]
PREFIX=fedora-rdo- type = url
location = http://tarballs.openstack.org/glance/glance-master.tar.gz
This setting would cause images to be tagged into the ``larsks/`` [keystone]
namespace and use Fedora as base image instead of the default CentOS. type = git
location = https://github.com/openstack/keystone
reference = stable/kilo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment