@@ -232,42 +232,48 @@ lazy val cli = project
232232 ),
233233 docker / dockerfile := {
234234 val binaryDistribution = pack.value
235- val script = (ThisBuild / baseDirectory).value / " bin" /
235+ val scipJavaWrapper = (ThisBuild / baseDirectory).value / " bin" /
236236 " scip-java-docker-script.sh"
237+ val dockerSetup = (ThisBuild / baseDirectory).value / " bin" /
238+ " docker-setup.sh"
237239 new Dockerfile {
238- from(" gradle:7.2.0-jdk8 " )
240+ from(" ubuntu:latest " )
239241
240242 // Setup system dependencies.
241243 run(" apt-get" , " update" )
242- run(" apt-get" , " install" , " --yes" , " maven" , " jq" )
243-
244- // Install Coursier.
245244 run(
245+ " apt-get" ,
246+ " install" ,
247+ " --yes" ,
248+ " jq" ,
249+ " wget" ,
246250 " curl" ,
247- " -fLo" ,
248- " /usr/local/bin/coursier" ,
249- " https://github.com/coursier/launchers/raw/master/coursier"
251+ " zip" ,
252+ " unzip" ,
253+ " git" ,
254+ // C++ and Python dependencies that may be needed by some random JVM
255+ // builds.
256+ " python3" ,
257+ " python3-pip" ,
258+ " autoconf" ,
259+ " automake" ,
260+ " libtool" ,
261+ " build-essential" ,
262+ " libtool" ,
263+ " make" ,
264+ " g++"
250265 )
251- run(" chmod" , " +x" , " /usr/local/bin/coursier" )
252266
253- // Pre-download Java 8, 11 and 17.
254- run(" coursier" , " java-home" , " --jvm" , " 8" )
255- run(" coursier" , " java-home" , " --jvm" , " 11" )
256- run(" coursier" , " java-home" , " --jvm" , " 17" )
267+ // Install SDKMAN
268+ add(dockerSetup, " /docker-setup.sh" )
269+ run(" bash" , " /docker-setup.sh" )
257270
258- // Install `sbt`
259- run(
260- " curl" ,
261- " -fLo" ,
262- " sbt.zip" ,
263- " https://github.com/sbt/sbt/releases/download/v1.8.2/sbt-1.8.2.zip"
264- )
265- run(" unzip" , " sbt.zip" )
266- run(" rm" , " sbt.zip" )
267- run(" ln" , " -sfv" , " /home/gradle/sbt/bin/sbt" , " /usr/local/bin/sbt" )
271+ env(" PATH" , " /opt/maven/maven-3.8.7/bin:${PATH}" )
272+ env(" PATH" , " /opt/gradle/gradle-7.6/bin:${PATH}" )
273+ env(" PATH" , " /root/.local/share/coursier/bin:${PATH}" )
268274
269275 // Install `scip-java` binary.
270- add(script , " /usr/local/bin/scip-java" )
276+ add(scipJavaWrapper , " /usr/local/bin/scip-java" )
271277 add(binaryDistribution, " /app/scip-java" )
272278 }
273279 }
0 commit comments