v4.0.0
What's Changed
The Docker Image resource is now a full Pulumi Custom Resource.
It uses the docker-go client library instead of invoking the Docker CLI.
As a result there are updates to the behavior of the Image resource and supporting types, as well as some minor name changes.
docker.Image:
New Features and Bug Fixes
- Support for Java and YAML
- Default support for Buildkit
- Build and push logs are streamed to the Pulumi build output
- Images no longer are built during preview, reducing preview time significantly
- Image will not be rebuilt if build context has not changed
- Image has access to local cache layers, improving build time
- Improved error handling for build failures
- Working examples for major cloud registries
Migrating to v4
Because the Image resource does not contain any backend state, migrating to this version does not need any resource imports or stack updates. For most use cases, it should be as straightforward as updating your pulumi-docker
version and adjusting your code to reflect the updated types.
UPDATE via #563
Because the new Image resource represents a change in how it is associated with a provider, a one-time manual stack update using pulumi state delete may be required.
The steps are as follows:
pulumi stack --show-urns
pulumi state delete <any Image URN>
<--- this is safe to do, as Images have no cloud state- upgrade to 4.x.x
pulumi up
This version of the provider defaults to building images with Buildkit. If you would like to keep the classic Docker builder, set new field Build.BuilderVersion
to BuilderV1
to continue using the classic Docker builder.
Inputs
LocalImageName
: Deprecated. UseImageName
in conjunction withSkipPush:true
.Build
: Updated. No longer a required input; defaults to using current directory as build context. No longer accepts a string for a custom build context. UseBuild.Context
instead.Build.Platform
: New. Specify a target platform for the image build. Note that this field supports a single value currently, not a list of target platforms.Build.CacheFrom
: Updated. No longer accepts a boolean. Specify images inBuild.CacheFrom.Images
. To fully leverage using a registry cache, images must be built with a cache manifest by passing"BUILDKIT_INLINE_CACHE": "1"
to `Build.Args
},Build.CacheFrom.Images
: New. ReplacesBuild.CacheFrom.Stages
. Defines a list of images to use as build cache.Build.CacheFrom.Stages
: Deprecated. Replaced byBuild.CacheFrom.Images
.Build.BuilderVersion
: New. Defaults to BuilderBuildKit. Set toBuilderV1
to continue using the classic Docker builder.
ExtraOptions
: Deprecated. This was a way to pass arbitrary CLI flags to the Docker CLI.
These are being implemented as top-level fields; currently available are:Build.Platform
Build.Target
Build.CacheFrom
Env
: Deprecated. This field’s use case was mainly for passingDOCKER_BUILDKIT=1
to the CLI invocation of docker build. UseBuild.BuilderVersion
instead. You do not need to specifyBuild.BuilderVersion
if you are running in Buildkit mode, which is the default.ImageName
: Updated. Must be of fully qualified repository format, i.e.registry.domain.abc/repositoryname/image
. The tag will be inferred as:latest
unless otherwise specified.Docker.io
will no longer be automatically inferred.
Outputs
Id
: Deprecated. UseImageName
for a unique identifier.Digest
: Deprecated as of an older version of pulumi-docker v3; this version removes it entirely.
Language specific type name changes
C Sharp
Docker.ImageRegistry → Docker.Inputs.RegistryArgs
Docker.DockerBuild → Docker.Inputs.DockerBuildArgs
Go
docker.ImageRegistry → docker.Registry
Python
DockerBuild → DockerBuildArgs
ImageRegistry → RegistryArgs
Changelog
- Implement Hybrid Functionality and add custom Image resource by @guineveresaenger in #413
- Change module versions to prep for v4 by @guineveresaenger in #429
- Add VERSION_PREFIX to prerelease Action by @guineveresaenger in #430
- Add IS_PRERELEASE:true to prerelease action workflow by @guineveresaenger in #431
- Update GitHub Actions workflows. by @pulumi-bot in #432
- Add Unit Tests for Input Parsing by @guineveresaenger in #433
- Add Buildkit Option by @guineveresaenger in #434
- Delete unused helper file by @guineveresaenger in #438
- Ensure forward build compatibility for resource provider by @AaronFriel in #444
- Ensure skipPush defaults to false by @guineveresaenger in #439
- Add Docker context build hash check by @guineveresaenger in #446
- Update GitHub Actions workflows. by @pulumi-bot in #454
- Update GitHub Actions workflows. by @pulumi-bot in #455
- Process and display build and push logs by @guineveresaenger in #450
- Use Docker credentials file to log in to registry by @guineveresaenger in #461
- Fix panic in Check function by @guineveresaenger in #462
- Set Warning to write to persistent logs by @guineveresaenger in #464
- Set Registry Server Name by @guineveresaenger in #465
- Add Cache From feature by @guineveresaenger in #467
- Deprecate extraOptions and env by @guineveresaenger in #468
- Enable cross platform builds by @guineveresaenger in #471
- Bump goreleaser action by @guineveresaenger in #474
- Upgrade terraform-provider-docker to v3.0.1 by @aq17 in #476
- Add Example documentation for Image by @guineveresaenger in #479
- Update GitHub Actions workflows. by @pulumi-bot in #482
- Compute default platform field by @guineveresaenger in #481
- fix: Docker auth config lookup portability by @AaronFriel in #480
- Alias Docker image to avoid deletion on upgrade to v4 by @guineveresaenger in #483
- Implement Target by @guineveresaenger in #499
- Ignore input changes to username and password by @guineveresaenger in #498
- Add Azure registry integration test by @guineveresaenger in #494
- Authenticate for
CacheFrom
via input credentials onImage
by @guineveresaenger in #500 - Add Container Registry Integration Tests for AWS ECR by @guineveresaenger in #502
- Update GitHub Actions workflows. by @pulumi-bot in #504
- Update GitHub Actions workflows. by @pulumi-bot in #509
- Add Container Registry Integration Tests for GCP by @guineveresaenger in #505
- Add EOF condition to special error case handling by @guineveresaenger in #506
- Update GitHub Actions workflows. by @pulumi-bot in #512
- Update GitHub Actions workflows. by @pulumi-bot in #513
- Add Container Registry Integration Tests for DigitalOcean by @jazzyfresh in #515
- Add Docker container registry tests by @guineveresaenger in #510
- Correctly ignore files from .dockerignore by @guineveresaenger in #508
- Remove OneOf implementation for Build type by @guineveresaenger in #518
- Update and clean up examples by @guineveresaenger in #519
- Flatten container registry tests by @guineveresaenger in #521
New Contributors
- @aq17 made their first contribution in #476
- @jazzyfresh made their first contribution in #515
Full Changelog: v3.6.1...v4.0.0