Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kolla Ansible
Commits
0e8f20aa
Commit
0e8f20aa
authored
9 years ago
by
Jenkins
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "update the image-building document"
parents
77d4449b
815fb844
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/image-building.rst
+43
-58
43 additions, 58 deletions
docs/image-building.rst
with
43 additions
and
58 deletions
docs/image-building.rst
+
43
−
58
View file @
0e8f20aa
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``
command
s
:
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment