Generic
The Generic environment
Environment
The Generic environment is a lightweight Linux environment, ideal for running binaries from compiled languages such as C, C++, Rust, Go, Zig, etc.
How it works
The start.bash file is executed at startup. You can modify it to do whatever you want: execution, compilation, Git synchronization, etc.
Examples
C
gcc is installed by default.
#!/bin/bash
echo "Compiling..."
gcc main.c -o main
echo "Running app"
./mainC++
g++ is installed by default.
#!/bin/bash
echo "Compiling..."
g++ main.cpp -o main
echo "Running app"
./mainRust
Rust is not installed by default. As it consumes a large amount of memory during compilation, it is recommended to compile locally and use Orion CLI to deploy your code.
Locally:
cargo build --release --target x86_64-unknown-linux-musl
# move the binary outside /target/ so the CLI can deploy it
# (change "app-name" by your binary name)
mv target/x86_64-unknown-linux-musl/release/app-name app-nameIn the server:
#!/bin/bash
chmod +x ./app-name
./app-nameGo
Go is not installed by default. You can either compile locally and then deploy the binary, or install Go on the server.
- Recommended: deploy via Orion CLI
#!/bin/bash
chmod +x ./main
./main- This script installs Go on first launch (this takes a few minutes). As compilation is quite slow, this is not recommended.
#!/bin/bash
GO_VERSION=1.26.3
if [ ! -f /home/container/.go/bin/go ]; then
echo "Installing Go..."
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -O /tmp/go.tar.gz
mkdir -p /home/container/.go
tar -C /home/container/.go --strip-components=1 -xzf /tmp/go.tar.gz
rm /tmp/go.tar.gz
echo "Go installed!"
fi
export PATH=/home/container/.go/bin:$PATH
go version
echo "Compiling..."
go build main.go
echo "Running app"
./mainZig
Zig is not installed by default. It is recommended to compile locally and use Orion CLI to deploy your code.
Locally:
zig build-exe main.zig -O ReleaseFast
# or static if needed:
zig build-exe main.zig -target x86_64-linux-musl -O ReleaseFastIn the server:
#!/bin/bash
chmod +x ./main
./mainOther languages
For other languages, simply deploy the final binary to the server and execute it. Orion CLI is recommended for deployment.
In the server:
#!/bin/bash
chmod +x ./binaryfile
./binaryfile