{"id":19506848,"url":"https://github.com/regis-leray/sbt-docker-image","last_synced_at":"2026-04-24T23:34:43.062Z","repository":{"id":72894036,"uuid":"144027283","full_name":"regis-leray/sbt-docker-image","owner":"regis-leray","description":"Thin wrapper over docker image - manage docker images with sbt (build/push/rm/tag/...)","archived":false,"fork":false,"pushed_at":"2019-12-04T14:26:45.000Z","size":61,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T09:42:26.685Z","etag":null,"topics":["docker","dockerfile","sbt","sbt-plugin","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/regis-leray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-08T14:42:13.000Z","updated_at":"2020-02-22T00:38:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfae6433-7d5d-4b64-bdba-bc8e5ce692c4","html_url":"https://github.com/regis-leray/sbt-docker-image","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/regis-leray/sbt-docker-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regis-leray%2Fsbt-docker-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regis-leray%2Fsbt-docker-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regis-leray%2Fsbt-docker-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regis-leray%2Fsbt-docker-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regis-leray","download_url":"https://codeload.github.com/regis-leray/sbt-docker-image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regis-leray%2Fsbt-docker-image/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32245150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","sbt","sbt-plugin","scala"],"created_at":"2024-11-10T22:38:44.078Z","updated_at":"2026-04-24T23:34:43.046Z","avatar_url":"https://github.com/regis-leray.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sbt-docker-image\n\nsbt-docker-image is a thin wrapper over docker cli, for managing docker images\n\n[![CircleCI](https://circleci.com/gh/regis-leray/sbt-docker-image/tree/master.svg?style=svg)](https://circleci.com/gh/regis-leray/sbt-docker/tree/master)\n[![codecov](https://codecov.io/gh/regis-leray/sbt-docker-image/branch/master/graph/badge.svg)](https://codecov.io/gh/regis-leray/sbt-docker-image)\n\n\nRequirements\n------------\n* Sbt (0.13.x or above)\n* Docker Cli\n\nSetup\n-----\n\nAdd sbt-docker as a dependency in `project/plugins.sbt`:\n```scala\naddSbtPlugin(\"com.github.regis-leray\" % \"sbt-docker-image\" % \"0.7.2\")\n```\nin your `build.sbt` need to activate manually the plugin for each project\n\n```scala\nlazy val root = project.in(file(\".\"))\n  .enablePlugins(DockerImagePlugin)\n```\n\nsbt-docker is an auto plugin, this means that sbt version 0.13.5 or higher is required.\nthe only dependency is on docker cli, need to be available in your PATH follow instructions [here](https://docs.docker.com/v17.09/engine/installation/)\n\nDocker command\n--------------\n\n* docker [OPTIONS] image push [ARGS]\n* docker [OPTIONS] image build [ARGS]\n* docker [OPTIONS] image tag [ARGS]\n* docker [OPTIONS] image rm [ARGS]\n\nAt any time you can provide docker [OPTIONS] by overriding `dockerOptions` property\n\n\n### Build an image\n\nSimply run `sbt dockerImg:build` from your prompt or `dockerImg:build` in the sbt console.\n\nThe Dockerfile should be located at the base directory of you project `./Dockerfile` \n\n\n```scala\n// Example if you need to override keys\n\nlazy val root = project.in(file(\".\"))\n  .settings(   \n      //override default tag  :: default `${organization.value}/${name.value}:${version.value}`\n      tagNames in DockerImg := Seq(\"org.me/hello:1.0\"),\n      //default name of dockerfile :: default `Dockerfile`\n      dockerfileName in DockerImg := \"Dockerfile-custom\"\n      //provide OPTIONS :: default `Nil`\n      dockerOptions in DockerImg := Seq(\"--tlsverify \")     \n      //provide build OPTIONS :: default `Nil`\n      dockerCmdOptions in DockerImg in build := Seq(\"--no-cache\"),\n      //default location of dockerfile :: default `baseDirectory`\n      buildContextPath in DockerImg in build := baseDirectory.value.asPath.resolve(\"docker-dir\"),      \n   )\n  .enablePlugins(DockerImagePlugin)\n```\n\nBy default we are tagging the builded image (`build -t`) by using `$organization/$name:$version` as default docker image tag name, \nyou can override, or add multiple tags by overriding `tagNames`\n\n```scala\nlazy val root = project.in(file(\".\")) \n .settings(tagNames in DockerImg in build += s\"quai.io/${name.value}:latest\")\n .enablePlugins(DockerImagePlugin)\n```\n\nMore informations here for the build [options](https://docs.docker.com/engine/reference/commandline/build/)\n\n### Tag an image\n\nTag an existing docker image with the `dockerImg:tag` task.\n\nAs source tag name we are using `tagNames.head`\n\nIt is required to override `targetImages` to provide docker target tag name,\n\n```scala\n// Example if you need to override keys\n\nlazy val root = project.in(file(\".\"))\n  .settings(\n      //provide push OPTIONS :: default `Nil`\n      targetImages in DockerImg in tag := Seq(\"org.me/hello:latest\")\n   )\n  .enablePlugins(DockerImagePlugin)\n```\n\n### Remove an image\n\nRemove a docker image from local registry with the `dockerImg:rm` task.\nBy default we are removing all the build images define by the property `tagNames`\n\n\n```scala\n// Example if you need to override keys\n\nlazy val root = project.in(file(\".\"))\n  .settings(\n      //provide rm OPTIONS :: default `Nil`\n      cmdOptions in DockerImg in rm := Seq(\"--no-prune\"),\n      //default value `dockerTagNames`\n      tagNames in DockerImg in rm := Seq(\"org.me/hello:1.0\")\n   )\n  .enablePlugins(DockerImagePlugin)\n```\n\n\n### Pushing an image\n\nAn image that have already been built can be pushed with the `dockerImg:push` task.\n\nBy default `dockerImg:push` will push your docker image tags define by the `tagNames` property but you can still override\n\n`tagNames` key is used to determine which image names to push\n\n```scala\n// Example if you need to override keys\n\nlazy val root = project.in(file(\".\"))\n  .settings(\n      //provide push OPTIONS :: default `Nil`\n      cmdOptions in DockerImg in push := Seq(\"--disable-content-trust\"),\n      tagNames in DockerImg in push := Seq(\"org.me/hello:1.0\")\n   )\n  .enablePlugins(DockerImagePlugin)\n```\n\nWith `docker push` you can specify which image to push by overriding settings `tagNames in DockerImg in push`, it will only apply this settings for the task `push`\n\n\n\u003e You need to be authenticated by using `docker login -u $DOCKER_ID_USER`, if not you can't push docker images\n\u003e \n\u003e https://docs.docker.com/docker-cloud/builds/push-images/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregis-leray%2Fsbt-docker-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregis-leray%2Fsbt-docker-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregis-leray%2Fsbt-docker-image/lists"}