-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM openjdk:8 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
olafurpg
Owner
|
||
ARG SCALAFMT_VERSION=2.4.2 | ||
ARG SCALAFMT_INSTALL_LOCATION=/usr/local/bin/scalafmt | ||
RUN set -ex \ | ||
&& apt-get update -y \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& echo insecure > "$HOME/.curlrc" \ | ||
This comment has been minimized.
Sorry, something went wrong.
bsolomon1124
|
||
&& curl -Lo coursier https://git.io/coursier-cli \ | ||
This comment has been minimized.
Sorry, something went wrong.
bsolomon1124
|
||
&& chmod u+x coursier \ | ||
&& ./coursier bootstrap "org.scalameta:scalafmt-cli_2.12:$SCALAFMT_VERSION" \ | ||
-r sonatype:snapshots \ | ||
-o "$SCALAFMT_INSTALL_LOCATION" \ | ||
--main org.scalafmt.cli.Cli \ | ||
&& rm -f coursier \ | ||
&& scalafmt --version | ||
CMD ["/usr/local/bin/scalafmt"] |
I think that a multi-stage build might be possible here and could drastically reduce the image size. But I'm not certain about that since I don't know scalafmt well enough. Example: https://github.com/hadolint/hadolint/blob/master/docker/Dockerfile.
One other suggestion would be to put the Dockerfile in
docker/Dockerfile
rather than at the project root.That will help avoid the common pitfall of sending a ton of files as part of the build context if they use, for instance,
docker build .