Skip to content

Instantly share code, notes, and snippets.

@theparticleman
Last active December 3, 2021 14:44
Show Gist options
  • Save theparticleman/1861411a9aa322755c9fd7c85fdba76a to your computer and use it in GitHub Desktop.
Save theparticleman/1861411a9aa322755c9fd7c85fdba76a to your computer and use it in GitHub Desktop.
Node, .NET Core, Python, Ruby, Rust, Kotlin and Swift build/runtime environments in Docker
docker run -v [local path]:/code -it node bash
cd /code
echo "console.log('Hello, World');" > app.js
node app.js
docker run -v [local path]:/code -it microsoft/dotnet bash
cd /code
dotnet new console
dotnet run
docker run -v [local path]:/code -it python:3 bash
cd /code
echo "print(\"Hello, World\")" > app.py
python app.py
docker run -v [local path]:/code -it ruby bash
cd /code
echo "puts 'Hello, World'" > app.rb
ruby app.rb
docker run -v [local path]:/code -it rust bash
cd /code
echo "fn main() { println!(\"Hello, World\");}" > app.rs
rustc app.rs
./app
docker run -v [local path]:/code -it zenika/alpine-kotlin bash
cd /code
echo "fun main(args: Array<String>){ println(\"Hello, World\")}" > app.kt
kotlinc app.kt -include-runtime -d app.jar
java -jar app.jar
docker run -v [local path]:/code -it swift bash
cd /code
echo "print(\"Hello, World\")" > app.swift
swift app.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment