Skip to content

v4.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 08 Mar 19:44
· 389 commits to master since this release
9da6e61

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:

  1. pulumi stack --show-urns
  2. pulumi state delete <any Image URN> <--- this is safe to do, as Images have no cloud state
  3. upgrade to 4.x.x
  4. 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. Use ImageName in conjunction with SkipPush: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. Use Build.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 in Build.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. Replaces Build.CacheFrom.Stages. Defines a list of images to use as build cache.
      • Build.CacheFrom.Stages: Deprecated. Replaced by Build.CacheFrom.Images.
      • Build.BuilderVersion: New. Defaults to BuilderBuildKit. Set to BuilderV1 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 passing DOCKER_BUILDKIT=1 to the CLI invocation of docker build. Use Build.BuilderVersion instead. You do not need to specify Build.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. Use ImageName 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

New Contributors

Full Changelog: v3.6.1...v4.0.0