|
1 | 1 | Docker-build is a command line tool for building docker images and uploading
|
2 |
| -them to the registry. It extends the low level '''docker build''' by building |
| 2 | +them to the registry. It extends the low level *docker build* by building |
3 | 3 | images with a Dockerfile, Vagrantfile or a rootfs archive.
|
4 | 4 |
|
5 | 5 | Once built the image can be uploaded to a registry, which could be the official
|
6 | 6 | docker registry or your private registry.
|
7 | 7 |
|
| 8 | +Getting started - Installation |
| 9 | +============================== |
| 10 | + $ virtualenv venv |
| 11 | + $ source venv/bin/activate |
| 12 | + $ pip install docker-build |
8 | 13 |
|
9 | 14 | Sample build and upload
|
10 | 15 | =======================
|
@@ -35,19 +40,17 @@ Registry configuration
|
35 | 40 | ======================
|
36 | 41 |
|
37 | 42 | There are two ways to configure registries. Either by command line argument
|
38 |
| -'''-r''' or in a registry configuration file. |
| 43 | +*-r* or in a registry configuration file with the argument *--rc*. |
39 | 44 |
|
40 |
| - $ docker-build -r https://foo:bar@localhost:5000 |
41 |
| - |
42 |
| - $ docker-build -r staging:localhost:5000 |
| 45 | + $ docker-build -r staging=localhost:5000 |
43 | 46 |
|
44 | 47 | $ docker-build --rc Dockerbuild.registries
|
45 | 48 |
|
46 | 49 |
|
47 | 50 | Registry configuration file
|
48 | 51 | ---------------------------
|
49 | 52 |
|
50 |
| -Registries can be defined in the file '''docker-build.registry''' in the same |
| 53 | +Registries can be defined in the file **docker-build.registry** in the same |
51 | 54 | folder where the docker-build.images can be found or as global settings in one
|
52 | 55 | of the pathes:
|
53 | 56 |
|
@@ -136,3 +139,19 @@ build from root filesystem
|
136 | 139 |
|
137 | 140 | Image('my-app', cmd='/opt/my-app/bin/app', base=root_image)
|
138 | 141 |
|
| 142 | +with environment variables |
| 143 | +-------------------------- |
| 144 | + |
| 145 | + #!docker-build -c |
| 146 | + # |
| 147 | + # Uses environment variables. |
| 148 | + # |
| 149 | + # Example call: |
| 150 | + # REVISION=1.2.3 ./environment.images |
| 151 | + # REVISION=2.3.4 docker-build -c environment.images |
| 152 | + |
| 153 | + import os |
| 154 | + |
| 155 | + revision = os.environ['REVISION'] |
| 156 | + |
| 157 | + Image('hello-world:%s' % revision, base=Image('hello-world')) |
0 commit comments