Supported Tags: 2.11.6
Scala is a programming language. The scala container can be used in two ways as follows.
Run the container using following command: $docker run –it –name=some name scala
You will get the scala shell. Type the following code in the scala shell: scala> object HelloWorld { | def main(args: Array[String]) { | println("Hello, world!") | } | }
Now run the example as follows: scala> HelloWorld.main(null) Or
If you can create program files and can compile and execute them. $docker run –it –name=some name scala bash
Create a HelloWorld.scala file with following contents. object HelloWorld { def main(args: Array[String]) { println("Hello, world!") } }
Compile it using following command:
scalac HelloWorld.scala
Now execute as follows:
scala HelloWorld
Content type
Image
Digest
Size
143.4 MB
Last updated
about 8 years ago
docker pull ibmcom/scala-ppc64le