Dockerfile Overwrite ARG values

Viewed 7414

I have a Dockerfile that has Scala and SBT as below:

# Scala and sbt Dockerfile
# Scala and SBT forked from: https://github.com/hseeberger/scala-sbt
# Adds Docker client installation additionally

# Pull base image
FROM  openjdk:$JAVA_VERSION

ARG SCALA_VERSION
ARG SBT_VERSION

# Scala expects this file
RUN touch /usr/lib/jvm/java-$JAVA_VERSION-openjdk-amd64/release

# Install Scala
## Piping curl directly in tar
RUN \
  curl -fsL http://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
  echo >> /root/.bashrc && \
  echo 'export PATH=~/scala-$SCALA_VERSION/bin:$PATH' >> /root/.bashrc

# Install sbt
RUN \
  curl -L -o sbt-$SBT_VERSION.deb http://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb && \
  dpkg -i sbt-$SBT_VERSION.deb && \
  rm sbt-$SBT_VERSION.deb && \
  apt-get update && \
  apt-get install sbt && \
  sbt sbtVersion

Now if I want to use this as my base image, I have the following question:

  1. Can I overwrite the ARG parameters in my new Dockerfile which will use the one above as a base image?
2 Answers
Related