{"id":37028096,"url":"https://github.com/sglahn/gradle-dockerfile-plugin","last_synced_at":"2026-01-14T03:21:06.878Z","repository":{"id":11138896,"uuid":"60449622","full_name":"sglahn/gradle-dockerfile-plugin","owner":"sglahn","description":"Gradle Plugin to build and push Docker images using an external Dockerfile.","archived":false,"fork":false,"pushed_at":"2022-06-29T19:23:14.000Z","size":177,"stargazers_count":15,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T09:45:53.939Z","etag":null,"topics":["docker","dockerfile","gradle","plugin"],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sglahn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-05T08:05:04.000Z","updated_at":"2024-06-17T16:39:51.000Z","dependencies_parsed_at":"2022-08-25T19:20:41.788Z","dependency_job_id":null,"html_url":"https://github.com/sglahn/gradle-dockerfile-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sglahn/gradle-dockerfile-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sglahn%2Fgradle-dockerfile-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sglahn%2Fgradle-dockerfile-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sglahn%2Fgradle-dockerfile-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sglahn%2Fgradle-dockerfile-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sglahn","download_url":"https://codeload.github.com/sglahn/gradle-dockerfile-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sglahn%2Fgradle-dockerfile-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","dockerfile","gradle","plugin"],"created_at":"2026-01-14T03:21:06.185Z","updated_at":"2026-01-14T03:21:06.869Z","avatar_url":"https://github.com/sglahn.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gradle Dockerfile Plugin\nGradle plugin to build and push Docker images using an external Dockerfile and without the need of inline configuration. This means you can use a normal Dockerfile and put it in your project.\nThe plugin is available through the [Gradle Plugin Portal](https://plugins.gradle.org).\n\n![Build State](https://github.com/sglahn/gradle-dockerfile-plugin/workflows/Build%20and%20Test/badge.svg)\n\n### Installation\nUse the plugin via the Gradle [plugins DSL](https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block):\n\nGroovy:\n```Groovy\nplugins {\n  id \"org.sglahn.gradle-dockerfile-plugin\" version \"0.8\"\n}\n```\nKotlin:\n```Kotlin\nplugins {\n  id(\"org.sglahn.gradle-dockerfile-plugin\") version \"0.8\"\n}\n```\nThe plugin will add the following tasks to your project:\n```sh\n$ ./gradlew tasks\nDocker tasks\n------------\ndockerBuild - Builds a new image with a Dockerfile.\ndockerPush - Pushes a docker image to a repository.\n```\n### The dockerBuild task\nThe `dockerBuild` task will build a new Docker image. The default settings are:\n\n - dockerFile: `${projectDir}/Dockerfile`.\n - imageName: `project.name`\n - tags: `project.version` and `latest`.\n\nFor more information see `Configuration` section.\n### The dockerPush task\nThe `dockerPush` task will push the Docker image to a Docker repository.\nIf authentication is required use [docker login](https://docs.docker.com/engine/reference/commandline/login/) to\nadd the credential to your `$HOME/.docker/config.json` file. [This](https://hub.docker.com/r/sglahn/gradle-dockerfile-plugin-example-project/) \nis how it looks like when the example project is pushed to DockerHub. When the property \"removeImagesAfterPush\" is set to `true`, \nthe image will be removed from the local repository after the push to a remote repository. This is useful e.g. for builds \non CI agents. \n### Configuration\nThe following configuration can be added to your Gradle build file:\n```gradle\ndocker {\n    // Image version. Optional, default = latest\n    imageVersion = version\n\n    // Image name. Optional, default = project.name\n    imageName = name\n\n    // Docker repository. Optional, default == no repository\n    dockerRepository = 'sglahn'\n\n    // Path or URL referring to the build context. Optional, default = ${project.projectDir.getAbsolutePath()}\n    buildContext = 'build-context'\n\n    // Path to the Dockerfile to use (relative to ${project.projectDir}). Optional, default = ${buildContext}/Dockerfile\n    dockerFile = 'src/main/docker/Dockerfile'\n\n    // Add a list of tags for an image. Optional, default = $imageVersion\n    tags = [version, 'latest', 'Hello']\n\n    // Set metadata for an image. Optional, default = no label applied\n    labels = ['branch=master', 'mylabel=test']\n\n    // name and value of a buildarg. Optional, default = no build arguments\n    buildArgs = ['http_proxy=\"http://some.proxy.url\"']\n\n    // Always remove intermediate containers, even after unsuccessful builds. Optional, default = false\n    removeIntermediateContainers = true\n\n    // Isolation specifies the type of isolation technology used by containers. Optional, default = default\n    isolation = 'default'\n\n    // Do not use cache when building the image. Optional, default = false\n    noCache = true\n\n    // Always attempt to pull a newer version of the image. Optional, default false\n    pull = true\n\n    // Suppress the build output and print image ID on success. Optional, default = true\n    quiet = false\n\n    // Remove image in local repository after push to a remote repository, useful for builds on CI agents. Optional, default = false\n    removeImagesAfterPush = true\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsglahn%2Fgradle-dockerfile-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsglahn%2Fgradle-dockerfile-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsglahn%2Fgradle-dockerfile-plugin/lists"}