I want to write a dockerfile manually without using any sbt plugins. I am using sbt 0.13.8. I looked at dockerfile reference but could not get enough insights for my requirement. A demo would be extremely helpful
To do so, you will use the docker run command. You use the -d flag to run the new container in “detached” mode (in the background). You also use the -p flag to create a mapping between the host's port 3000 to the container's port 3000. Without the port mapping, you wouldn't be able to access the application.
If you mean write a Dockerfile producing an image able to run an sbt project, you can take a look at William-Yeh/docker-sbt
:
# Sbt on Java 7
#
# URL: https://github.com/William-Yeh/docker-sbt
#
# @see http://www.scala-sbt.org/release/tutorial/Manual-Installation.html
#
# Version 0.7
FROM williamyeh/java7
MAINTAINER William Yeh <[email protected]>
ENV SBT_VERSION 0.13.8
ENV SBT_JAR https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/$SBT_VERSION/sbt-launch.jar
ADD $SBT_JAR /usr/local/bin/sbt-launch.jar
COPY sbt.sh /usr/local/bin/sbt
RUN echo "==> fetch all sbt jars from Maven repo..." && \
echo "==> [CAUTION] this may take several minutes!!!" && \
sbt
VOLUME [ "/app" ]
WORKDIR /app
# Define default command.
ENTRYPOINT ["sbt"]
CMD ["--version"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With