{"id":18383436,"url":"https://github.com/dwolla/sbt-docker-containers","last_synced_at":"2025-04-06T23:32:18.492Z","repository":{"id":8570148,"uuid":"57158250","full_name":"Dwolla/sbt-docker-containers","owner":"Dwolla","description":"SBT plugin to define and manage Docker containers based on images creating using sbt-native-packager","archived":false,"fork":false,"pushed_at":"2025-03-17T21:48:06.000Z","size":109,"stargazers_count":9,"open_issues_count":3,"forks_count":6,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-17T22:38:03.012Z","etag":null,"topics":["docker","sbt","sbt-plugin","scala"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dwolla.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-26T20:03:43.000Z","updated_at":"2025-03-17T21:17:56.000Z","dependencies_parsed_at":"2024-01-27T01:40:03.696Z","dependency_job_id":"d5d95d19-d3d1-4559-a42d-265f4dc9f2f8","html_url":"https://github.com/Dwolla/sbt-docker-containers","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dwolla%2Fsbt-docker-containers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dwolla%2Fsbt-docker-containers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dwolla%2Fsbt-docker-containers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dwolla%2Fsbt-docker-containers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dwolla","download_url":"https://codeload.github.com/Dwolla/sbt-docker-containers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569124,"owners_count":20959758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","sbt","sbt-plugin","scala"],"created_at":"2024-11-06T01:11:27.601Z","updated_at":"2025-04-06T23:32:15.372Z","avatar_url":"https://github.com/Dwolla.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Containers Plugin\n\n![Dwolla/sbt-docker-containers CI](https://github.com/Dwolla/sbt-docker-containers/actions/workflows/ci.yml/badge.svg)\n[![license](https://img.shields.io/github/license/Dwolla/sbt-docker-containers.svg?maxAge=2592000\u0026style=flat-square)]()\n\nSBT Plugin that adds tasks to manage Docker containers using images created by the [sbt-native-packager](http://www.scala-sbt.org/sbt-native-packager/) Docker packaging format.\n\nRequires the [`docker`](http://docker.com) command-line tool to be on the path.\n\n## Installation and Enabling\n\nIn `project/plugins.sbt`, add the following:\n\n```scala\naddSbtPlugin(\"com.dwolla.sbt\" % \"docker-containers\" % \"***VERSION***\")\n```\n\nThen enable the plugin in `build.sbt`. For example:\n\n```scala\nval app = (project in file(\".\")).enablePlugins(DockerContainerPlugin)\n```\n\nThis will also enable `DockerPlugin` from [sbt-native-packager](http://www.scala-sbt.org/sbt-native-packager/).\n\n## Available Settings\n\n### Container Memory Limitation\n\n```scala\ndockerContainerMemoryLimit := Option(\"192M\")\n```\n\nSets the memory limit for the container. Maps to the `--memory` Docker command line option.\n\n### Port Publishing\n\n#### `dockerContainerPublishAllPorts`\n\n```scala\ndockerContainerPublishAllPorts := true\n```\n\nWhen set to true, Docker will map any exposed ports not specifically assigned to a host port to ports in the ephemeral range. This maps to the `--publish-all` Docker command line option.\n\n#### `dockerContainerPortPublishing`\n\n```scala\ndockerContainerPortPublishing := Map(8080 → Option(4242), 7777 → AutoAssign)\n```\n\nMaps exposed container ports to either specific host ports, or `AutoAssign`, which indicates the port should be published on an ephemeral port. Each mapping corresponds to a `--publish {container}:{host}` Docker command line option.\n\nIn the given example, the container port `8080` will be published on host port `4242`, and the container port `7777` will be published on a randomly assigned ephemeral port.\n\n### Container Name\n\n```scala\n(name in createLocalDockerContainer) := normalizedName.value\n```\n\nThe container name will be the normalized project name by default, but this can be overridden by setting `name in createLocalDockerContainer`.\n\n### Linked Containers\n\n```scala\ndockerContainerLinks := Map(\"container-name\" → \"container-name\")\n```\n\nCreates links from the new container to the specified container. The key side of the mapping is the actual container name, while the value side is the alias inside the new container. Typically, the alias matches the container name, but it can be different if needed.\n\nLinks can also be added using the syntax below:\n\n```scala\ndockerContainerLinks += \"container-name\" → \"container-name\"\ndockerContainerLinks ++= Map(\"container-name\" → \"container-name\", \"container-two\" → \"container-two\")\n```\n\nBoth of these examples will append new linked containers to any previously established in the build definition.\n\n### Additional Environment Variables\n\n```scala\ndockerContainerAdditionalEnvironmentVariables := Map(\"NAME\" → Option(\"value\"), \"FROM_HOST\" → Passthru)\n```\n\nOperators can augment or override the environment specified by the container’s image by giving mappings from the name of the environment variable to either the value or `Passthru`.\n\nIf `Passthru` is specified and the variable name is present in the host’s environment, the value in the container will be set to match that of the host. If the variable is not set in the host’s environment, the variable will be unset in the container (even if it is set by the image). Docker’s behavior is [documented here](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables-e-env-env-file), but supplying an environment file is not supported by this plugin at this time.\n\n## `docker:createLocal` Task\n\nUses the Docker image created by `docker:publishLocal` and creates a container configured as defined.\n\n## `docker:startLocal ` Task\n\nRuns the container created by `docker:createLocal`. This action is also available using `docker:runLocal`, but this is deprecated and will be removed in a future version of the plugin.\n\n## `docker:clean` Task\n\nStops and removes the container and image created by the `docker:publishLocal` and `docker:createLocal` tasks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwolla%2Fsbt-docker-containers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwolla%2Fsbt-docker-containers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwolla%2Fsbt-docker-containers/lists"}