You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary of changes:
- Docker Remote API support
- addFile fixes
- Base image for Java 8 and fixes
- External Dockerfile support
- Gradle 2.0 compatibility
- Image tag version and fixes
Copy file name to clipboardExpand all lines: CHANGELOG.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,45 @@
1
1
# Changelog
2
2
3
+
## Version 1.2 (2014-07-28)
4
+
5
+
#### Docker Remote API
6
+
It is now possible to use the Docker Remote API instead of the `docker` command line tool. See the [docs](README.md#docker-remote-api) for more information (PR #10). This is particularly useful for users who do not have Docker installed locally.
7
+
8
+
#### addFile
9
+
* Fixed `addFile` accepting a copySpec as an argument (issue #4).
10
+
*`addFile` now accepts the destination path as an optional second argument (default: `/`)
11
+
12
+
#### Base image
13
+
* Fixed setting of a custom base image both through the plugin extension or a task property (issue #11).
14
+
* Fixed default base image detection based on project's `targetCompatibility`.
15
+
* Added default base image for Java 8 (PR #9).
16
+
17
+
#### External Dockerfile
18
+
* Supply an external Dockerfile instead of defining it in the build script. See the [docs](README.md#building-your-dockerfile) (issue #13).
19
+
* Mix and match loading external Dockerfiles and extending in the build script.
20
+
21
+
#### Gradle 2.0
22
+
The plugin is now compatible with Gradle 2.0 (see the [docs](README.md#note-to-gradle-1.x-users) if you are using Gradle 1.x)
23
+
24
+
#### Image tagging
25
+
* Possible to set docker image tag version to something else than *:latest* (PR #5).
26
+
* Fixed setting of the image tag name and version (issue #15).
27
+
28
+
Many thanks to the contributors
29
+
30
+
*[@aglover](https://github.com/aglover)
31
+
*[@Teudimundo](https://github.com/Teudimundo)
32
+
*[@sfitts](https://github.com/sfitts)
33
+
*[@frvi](https://github.com/frvi)
34
+
*[@mattgruter](https://github.com/mattgruter)
35
+
36
+
3
37
## Version 1.1.1 (2014-06-13)
4
38
* Possible to build without specifying group.
5
39
* Failing gradle build if Docker execution fails.
6
40
7
41
Many thanks to the contributors:
42
+
8
43
*[@Teudimundo](https://github.com/Teudimundo)
9
44
*[@frvi](https://github.com/frvi)
10
45
@@ -20,6 +55,7 @@ Many thanks to the contributors:
20
55
* Fixed path seperator bug for integration testing on Windows.
Copy file name to clipboardExpand all lines: README.md
+65-12Lines changed: 65 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
This plugin for [Gradle](http://www.gradle.org/) adds the capability to build und publish [Docker](http://docker.io/) images from the build script.
6
6
7
+
See the [change log](CHANGELOG.md) for information about the latest changes.
8
+
7
9
## Extending the application plugin
8
10
The gradle-docker plugin adds a task `distDocker` if the project already has the [application plugin](http://www.gradle.org/docs/current/userguide/application_plugin.html) applied:
9
11
@@ -16,21 +18,21 @@ Executing the `distDocker` task builds a docker image containing all application
16
18
17
19
By default `distDocker` uses a base image with a Java runtime according to the project's `targetCompatibility` property. The docker image entry point is set to the start script created by the application plugin. Checkout the [example](example/) project.
18
20
19
-
*Note: Only JVM based projectsare supported.*
21
+
**Note**: The creation of the convention task `distDocker` is currently only supported for JVM based application projects. If you are not using a JVM based application, use the task type `Docker` directly to create a task to build Docker images of your application.
20
22
21
23
22
-
## Stand-alone
23
-
The docker plugin introduces the task type `Docker`. A task of this type can be used to build Docker images. See the [Dockerfile documentation](http://docs.docker.com/reference/builder/) for information about how docker containers are built.
24
+
## The `Docker`task
25
+
The docker plugin introduces the task type `Docker`. A task of this type can be used to build and publish Docker images. See the [Dockerfile documentation](http://docs.docker.com/reference/builder/) for information about how Docker images are built.
24
26
25
-
The following example builds a docker image for the popular reverse proxy nginx. The image will be tagged with the name `foo/nginx`. The example is taken from the official Dockerfile [examples](http://docs.docker.com/reference/builder/#dockerfile-examples):
27
+
In the following example we build a Docker image in our Gradle build script for the popular reverse proxy nginx. The image will be tagged with the name `foo/nginx`. The example is taken from the official Dockerfile [examples](http://docs.docker.com/reference/builder/#dockerfile-examples):
In the example above the instructions on how to build the nginx Docker image are configured **inline** using methods of the Docker Gradle task. During task execution the plugin first creates a [Dockerfile](https://docs.docker.com/reference/builder/) which it then passes to Docker to build the image.
56
+
57
+
However instead of defining the build instructions inline in the task it is possible to supply an **external Dockerfile**. If the task property `dockerfile` is set to the path of an existing Dockerfile the plugin will this instead of build the image.
58
+
59
+
You can even combine these two methods: Supplying an external Dockerfile and extending it by defining instructions in the task. The build instructions from the external Dockerfile are read first and the instructions defined in the task appended. If an external Dockerfile is supplied, the `baseImage` property is ignored.
60
+
52
61
## Configuring the plugin
53
-
The plugin exposes configuration options on 2 levels: globally through a plugin extension and on a per task basis. The plugin tries to always set sensible defaults for all properties. (The `maintainer` property is an exception. It is initialized with a useless default string.)
62
+
The plugin exposes configuration options on 2 levels: globally through a plugin extension and on a per task basis. The plugin tries to always set sensible defaults for all properties.
54
63
55
64
### Global configuration through plugin extension properties
56
65
Configuration properties in the plugin extension `docker` are applied to all Docker tasks. Available properties are:
@@ -59,6 +68,7 @@ Configuration properties in the plugin extension `docker` are applied to all Doc
59
68
-`baseImage` - The base docker image used when building images (i.e. the name after `FROM` in the Dockerfile).
60
69
-`maintainer` - The name and email address of the image maintainer.
61
70
-`registry` - The hostname and port of the Docker image registry unless the official Docker index is used.
71
+
-`useApi` - Use the Docker Remote API instead of a locally installed `docker` binary. See [below](https://github.com/Transmode/gradle-docker/blob/master/README.md#docker-remote-api)
62
72
63
73
Example to set the base docker image and maintainer name for all tasks:
64
74
@@ -79,9 +89,9 @@ tag = "${project.group}/${applicationName}:${tagVersion}"
79
89
80
90
Where:
81
91
82
-
-`project.group` -- This is a standard Gradle project property. If not defined, the `{project.group}/` is omitted.
83
-
-`applicationName` -- The name of the application being "dockerized".
84
-
-`tagVersion` -- Optional version name added to the image tag name.
92
+
-`project.group` - This is a standard Gradle project property. If not defined, the `{project.group}/` is omitted.
93
+
-`applicationName` - The name of the application being "dockerized".
94
+
-`tagVersion` - Optional version name added to the image tag name. Defaults to `project.version` or "latest" if `project.version` is unspecified.
85
95
86
96
The following example task will tag the docker image as `org.acme/bar:13.0`:
If no base image is configured through the extension or task property a suitable image is chosen based on the project's `targetCompatibility`. A project targeting Java 7 will for instance get a default base image with a Java 7 runtime.
100
110
111
+
## Docker Remote API
112
+
By default the plug-in will use the `docker` command line tool to execute any docker commands (such as `build` and `push`). However, it can be configured to use the [Docker Remote API](https://docs.docker.com/reference/api/docker_remote_api/) instead via the `useApi` extension property:
113
+
114
+
```gradle
115
+
docker {
116
+
useApi true
117
+
}
118
+
```
119
+
120
+
Use of the remote API requires that the Docker server be configured to listen over HTTP and that it have support for version 1.11 of the API (connecting over Unix Domain sockets is not supported yet). The following configuration options are available:
121
+
122
+
*`hostUrl` - set the URL used to contact the Docker server. Defaults to `http://localhost:2375`
123
+
*`apiUsername` - set the username used to authenticate the user with the Docker server. Defaults to `nil` which means no authentication is performed.
124
+
*`apiPassword` - set the password used to authenticate the user with the Docker server.
125
+
*`apiEmail` - set the user's email used to authenticate the user with the Docker server.
126
+
127
+
For example:
128
+
129
+
```gradle
130
+
docker {
131
+
useApi true
132
+
hostUrl 'http://myserver:4243`
133
+
apiUsername 'user'
134
+
apiPassword 'password'
135
+
apiEmail 'me@mycompany.com'
136
+
}
137
+
```
138
+
139
+
101
140
## Requirements
102
-
* Gradle 1.10
103
-
* Docker 0.6+
141
+
* Gradle 2.x
142
+
* Docker 0.11+
143
+
144
+
#### Note to Gradle 1.x users
145
+
The plugin is built with Gradle 2.x and thus needs version 2.0 or higher to work due to a newer version of Groovy version included in Gradle 2.x (2.3 vs. 1.8.6). To use the plugin with Gradle 1.x you have to add Groovy's upward compatibility patch by adding the following line to your build file:
You need to have docker installed in order to build docker images. However if the `dryRun` task property is set to `true` all calls to docker are disabled. In that case only the Dockerfile and its context directory will be created.
157
+
#### Note to native docker client users
158
+
If you are not using Docker's remote API (`useApi = false`, i.e. the default behaviour) you need to have Docker installed locally in order to build images. However if the `dryRun` task property is set to `true` all calls to Docker are disabled. In that case only the Dockerfile and its context directory will be created.
0 commit comments