Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mozilla/docker-sbt
Dockerfile for sbt (Scala build tool)
https://github.com/mozilla/docker-sbt
Last synced: 2 months ago
JSON representation
Dockerfile for sbt (Scala build tool)
- Host: GitHub
- URL: https://github.com/mozilla/docker-sbt
- Owner: mozilla
- License: mpl-2.0
- Created: 2018-06-13T22:54:30.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-08-03T12:54:44.000Z (over 1 year ago)
- Last Synced: 2024-10-06T04:26:02.431Z (2 months ago)
- Language: Dockerfile
- Size: 20.5 KB
- Stars: 124
- Watchers: 13
- Forks: 37
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-hacking-lists - mozilla/docker-sbt - Dockerfile for sbt (Scala build tool) (Dockerfile)
README
# docker-sbt
Dockerfile for sbt (Scala build tool)This is built on top of the
[openjdk](https://hub.docker.com/_/openjdk/) image
and takes inspiration from
[hseeberger/scala-sbt](https://github.com/hseeberger/scala-sbt).## Usage
Install [Docker](https://www.docker.com/) and pull the image
([mozilla/sbt](https://hub.docker.com/r/mozilla/sbt/) on DockerHub):docker pull mozilla/sbt
You can then run `sbt` inside docker to compile code like:
docker run -it --rm mozilla/sbt sbt shell
If you want to execute sbt commands on a project on your local
filesystem, you may want to mount the current directory and various
local caches as volumes and set the working directory as well:docker run -it --rm -v ~/.ivy2:/root/.ivy2 -v ~/.sbt:/root/.sbt -v $PWD:/app -w /app mozilla/sbt sbt shell
## Building
To build, you need to specify the desired openjdk and sbt versions via
`--build-arg` parameters:docker build --build-arg OPENJDK_TAG=11.0.13 --build-arg SBT_VERSION=1.6.2 .
## Pushing a new tag to DockerHub
To push and tag a new image with updated versions of openjdk and sbt,
you'll need to have a DockerHub account that's a member of the appropriate
Mozilla organization and be logged in to DockerHub:docker login --username=mydockerhubusername
Then use the following recipe to build and push:
```bash
OPENJDK_TAG=11.0.13
SBT_VERSION=1.6.2docker build \
--build-arg OPENJDK_TAG=$OPENJDK_TAG \
--build-arg SBT_VERSION=$SBT_VERSION \
--tag mozilla/sbt:${OPENJDK_TAG}_${SBT_VERSION} \
--tag mozilla/sbt:latest \
.docker push mozilla/sbt:${OPENJDK_TAG}_${SBT_VERSION}
docker push mozilla/sbt:latest
```