Skip to content
Snippets Groups Projects
Select Git revision
  • dd640054b7619f00fe4bffa0c1a2180e4708fd91
  • main default protected
  • 1-fix-assignment-errors
  • testfail
4 results

Dockerfile

Blame
  • Dockerfile 1.33 KiB
    FROM openjdk:21-jdk-slim-bullseye
    
    # Install some basic development utilities
    RUN apt-get update && apt-get install -y \ 
      curl \
      git \
      python3 \
      zip \
      && rm -rf /var/lib/apt/lists/* \
      && curl -fsSL https://deb.nodesource.com/setup_17.x | bash \
      && apt-get install -y nodejs \
      && npm install -g yarn \
      && rm -rf /var/lib/apt/lists/* 
    
    # User the Java-based launcher as Alpine Linux and Graal native compiled images of CS don't like
    # Alpine Linux (due to musl instead of gcc)
    RUN bash -c 'curl -fLo /usr/bin/cs https://git.io/coursier-cli' && \
        chmod u+x /usr/bin/cs
    
    # Put Coursier-installed artifacts on the path
    ENV PATH="$PATH:/root/.local/share/coursier/bin"   
    
    # Get sbt
    RUN bash -c 'cs install sbt'
    
    # Get http server
    RUN bash -c 'npm install -g http-server'
    
    # Precache sbt version as part of the image.
    ARG SBT_VERSION=1.7.0
    ARG SCALA_VERSION=3.1.3
    ARG SCALAJS_VERSION=1.10.1
    RUN mkdir -p /sbtprecacheproj/project && \
      cd /sbtprecacheproj && \
      echo sbt.version=${SBT_VERSION} > project/build.properties && \
      echo 'addSbtPlugin("org.scala-js" % "sbt-scalajs" % "'${SCALAJS_VERSION}'")' > project/plugins.sbt && \
      echo '@main def hello = println("hello")' > main.scala && \
      echo 'enablePlugins(ScalaJSPlugin); scalaVersion := "'${SCALA_VERSION}'"' > build.sbt && \
      sbt fastLinkJS && cd / && rm -r -f /tmp/sbt-precompile