436 Commits

Author SHA1 Message Date
Cicio Flaviu
7f1655e5cb Add package-info to buildpack.platform.docker.ssl
See gh-20913
2020-04-10 08:57:23 -05:00
Phillip Webb
ffd499fdc7 Attempt to fix failing Windows test 2020-04-06 23:02:12 -07:00
Phillip Webb
5b374e833b Cleanup paths to fix tests running on Windows 2020-04-06 20:33:33 -07:00
Scott Frederick
cc2852ce79 Polish 2020-04-01 18:43:11 -05:00
Scott Frederick
a01c8452cb Support CNB builder platform API 0.3
This commit adds support for Cloud Native Buildpacks builder platform
API 0.3, which is the latest platform API available currently. Support
for platform API 0.1 has been removed, adopting the policy of the pack
CLI to support the current platform API version and one version prior.

Fixes gh-20757
2020-04-01 17:18:46 -05:00
Scott Frederick
bb9e37e119 Use platform API builder image tags
CNB builder images are now being tagged in a manner that indicates
the version of the platform API implemented. This allows Spring Boot
to default to a builder tag that guarantees API compatibility while
allowing for updates to bundled buildpacks.

Fixes gh-20171
2020-04-01 16:18:05 -05:00
Phillip Webb
4dad56a491 Restructure and polish docker code
Restructure and polish docker code to fix a package tangle and
provide better separation of concerns.
2020-04-01 11:51:33 -07:00
Scott Frederick
ed6e54218d Support remote Docker daemon for building images
Prior to this commit, the build plugin goal/task for building images
required a locally running Docker daemon that was accessed via a
non-networked socket or pipe.

This commit adds support for remote Docker daemons at a location
specified by the environment variable `DOCKER_HOST`. Additional
environment variables `DOCKER_TLS_VERIFY` and `DOCKER_CERT_PATH`
are recognized for configuring a secure TLS connection to the daemon.

Fixes gh-20538
2020-03-30 17:06:02 -05:00
Phillip Webb
0717de723f Polish 2020-03-23 20:03:44 -07:00
dreis2211
9588188800 Use isEmpty() where possible
See gh-20370
2020-03-03 18:33:26 -05:00
Scott Frederick
296a13a479 Fix unit test case formatting 2020-02-27 16:43:56 -06:00
Scott Frederick
b00ed5b143 Remove unused imports 2020-02-27 16:17:19 -06:00
Scott Frederick
ada0741e10 Polish Docker client exception handling 2020-02-27 16:09:30 -06:00
Mike Smithson
6f095d6fec Improve error message from image building
Translate IOException to DockerException for a more meaningful error
message when the Docker daemon is not available.

Fixes gh-20151
2020-02-27 15:51:58 -06:00
dreis2211
4f824bf9ad Fix duplicate words
See gh-20210
2020-02-18 13:34:56 +01:00
Scott Frederick
e294d26458 Set ephemeral builder container creation to a fixed date
This commit fixes the `Created` date and time of the ephemeral builder
container image at the Windows epoch plus one second
(1980-01-01T00:00:01Z). This date matches the created date of the builder
image and influences the created date of the resulting image. Using
a fixed date for images ensures that the digest is consistent for all
images with the same version.

Fixes gh-20126
2020-02-12 13:55:54 -06:00
Scott Frederick
191dce3f5e Set Spring Boot version in ephemeral builder
This commit adds a `createdBy` structure to the metadata of the ephemeral
builder container image that identifies Spring Boot as the creator of the
image, along with the Spring Boot version.

See gh-20126
2020-02-12 13:31:21 -06:00
Scott Frederick
12c640e133 Upgrade default image builder version
This commit upgrades the default CNB builder image from
cloudfoundry/cnb:0.0.43-bionic to cloudfoundry/cnb:0.0.53-bionic.
It also adds integration tests for the Maven and Gradle plugins
to verify both versions are supported.
2020-02-06 17:24:29 -06:00
Scott Frederick
d07062652e Add support for CNB platform API v0.2
Cloud Native Buildpacks platform API version 0.2 introduced
two breaking changes: the order of invoking the restore and analyze
phases was reversed, and the cache phase was removed in favor of
distributing caching across other phases.

This commit adds support for Cloud Native Buildpacks builders that
implement platform API version 0.2, while maintaining compatibility
with builders that implement Lifecycle version platform API
version 0.1.

Closes gh-19829
2020-02-06 17:24:29 -06:00
Phillip Webb
cbacab5e26 Polish 2020-01-30 17:14:36 -08:00
Phillip Webb
234c5033d4 Polish whitespace 2020-01-30 17:09:49 -08:00
Scott Frederick
b281af0b9b Remove adding of existing layers to EphemeralBuilder
Layers were being added to the EphemeralBuilder each time one was
created, but those layers already existed in the base builder image.

Closes gh-19832
2020-01-30 16:34:02 -06:00
Andy Wilkinson
2725264be1 Polishing formatting of DockerApi 2020-01-30 14:08:45 +00:00
Andy Wilkinson
28442b5ca5 Lower the minimum required Docker API version to 1.24
Closes gh-19945
2020-01-30 13:57:18 +00:00
Andy Wilkinson
54b3f480b4 Use posix long names when creating tar archive for image building
Fixes gh-19964
2020-01-30 13:31:27 +00:00
Scott Frederick
c6a6024062 Stop image building on error from builder
Previously, the image builder used by the build tool plugins ignored
errors from lifecycle phases and continued with subsequent phases.

This commit inspects the status of the builder container after each
lifecycle phase and aborts the image building process if the exit
status of the container after any phase is non-zero.

Fixes #19949
2020-01-29 17:51:32 -06:00
dreis2211
d8e2349e47 Use Supplier variants of Assert
See gh-19864
2020-01-28 15:04:11 +01:00
Andy Wilkinson
63b736d1f0 Fix NPE when waiting for named socket path to become available
Fixes gh-19941
2020-01-27 11:38:19 +00:00
Stephane Nicoll
3290313eb7 Fix Docker socket creation on Windows
Closes gh-19908
2020-01-27 07:29:16 +01:00
Andy Wilkinson
0a9fe65443 Use line endings on all OSs when writing image config JSON
Previously \r\n was used on Windows and \n was used on other
platforms. This resulted in different JSON content being written to
the archive. As the config's entry name is the SHA-256 hash of its
content, it also resulted in the entry name being different.

This commit updates the JSON that's written into the archive to use
\n line endings, irrespective of the OS on which the image is being
built.

See gh-19828
2020-01-23 14:37:06 +00:00
Andy Wilkinson
a0b4cdee44 Make line ending expectations in TotalProgressBarTests OS-independent
See gh-19828
2020-01-23 14:14:14 +00:00
Stephane Nicoll
105db66553 Polish 2020-01-23 14:04:19 +01:00
Andy Wilkinson
0bd0b2a6c0 Add support for building OCI images using the Gradle plugin
Closes gh-19831
2020-01-23 10:52:57 +00:00
Phillip Webb
e0013454b5 Use parentheses when declaring dependencies
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.

Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
2020-01-22 16:02:38 -08:00
Phillip Webb
0209cd3e4c Polish quote form used in Gradle scripts
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
2020-01-22 15:49:52 -08:00
Phillip Webb
e28338d6cd Rename spring-boot-cloudnativebuildpack
Rename the `spring-boot-cloudnativebuildpack` module to
`spring-boot-buildpack-platform` and update the the package
name to `org.springframework.boot.buildpack.platform`.

Closes gh-19851
2020-01-22 11:01:32 -08:00