Skip to content

Encounters error if imageId file exists, and the image it's referring is already built ("repoTags" is null) #1227

Description

@nvilagos

Expected Behavior

DockerBuildImage should be able to successfully finish the build Docker image task.

Current Behavior

DockerBuildImage fails the build Docker image task if the image is already built previously and the following file exists: build/.docker/docker_buildImage-imageId.txt.

The error message is the following:

Cannot invoke "java.util.List.containsAll(java.util.Collection)" because "repoTags" is null

gradle-docker-plugin-evidence-01

gradle-docker-plugin-evidence-02

gradle-docker-plugin-evidence-03

gradle-docker-plugin-evidence-04

gradle-docker-plugin-evidence-05

gradle-docker-plugin-evidence-06

Context

I want to build a Docker image as a Gradle task so I can use it in a later task.

Steps to Reproduce (for bugs)

  1. Run the Docker build for the first time.
  2. Keep intact the generated files and images.
  3. Run the Docker build again to make it fail.

Your Environment

Gradle Docker plugin artifact: com.bmuschko.docker-remote-api:9.4.0
Gradle version: 8.11.1
OS: Windows 11

Possible workaround

Before every Docker image build, delete either the previously built Docker image, or the following file: build/.docker/docker_buildImage-imageId.txt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions