Sign inSign up

monkfromearth/monk-lang

By monkfromearth

•Updated about 1 year ago

Monk Lang - A minimalist, readable, and performant programming language

Image
0

688

monkfromearth/monk-lang repository overview

⁠Monk Lang Docker Images

Official Docker images for Monk Lang⁠ - A minimalist, readable, and performant programming language.

⁠Quick Start

# Run REPL interactively
docker run --rm -it monkfromearth/monk-lang

# Execute a Monk Lang script
echo 'show("Hello from Docker!")' | docker run --rm -i monkfromearth/monk-lang monk repl

# Run built-in examples
docker run --rm monkfromearth/monk-lang monk run /usr/local/share/monk/examples/01-basic-language-features/00_basic_arithmetic.monk

⁠Available Tags

⁠Latest Release
  • monkfromearth/monk-lang:latest - Latest Ubuntu-based image
  • monkfromearth/monk-lang:v0.0.7 - Specific version (Ubuntu-based)
  • monkfromearth/monk-lang:0.0 - Minor version (Ubuntu-based)
  • monkfromearth/monk-lang:0 - Major version (Ubuntu-based)
⁠Variant-Specific Tags
  • monkfromearth/monk-lang:ubuntu - Ubuntu 22.04 based (default)
  • monkfromearth/monk-lang:alpine - Alpine Linux based (smaller)
⁠Version + Variant Tags
  • monkfromearth/monk-lang:v0.0.7-ubuntu - Specific version, Ubuntu
  • monkfromearth/monk-lang:v0.0.7-alpine - Specific version, Alpine
  • monkfromearth/monk-lang:latest-ubuntu - Latest Ubuntu variant
  • monkfromearth/monk-lang:latest-alpine - Latest Alpine variant

⁠Image Variants

⁠Ubuntu (Default)
  • Base: ubuntu:24.04
  • Size: ~120MB
  • Use case: General purpose, full compatibility
  • User: monk (non-root for security)
⁠Alpine
  • Base: alpine:3.21
  • Size: ~40MB
  • Use case: Minimal size, container orchestration
  • User: monk (non-root for security)

⁠Registries

Images are published to multiple registries:

⁠Docker Hub
  • docker.io/monkfromearth/monk-lang:latest
  • Pull: docker pull monkfromearth/monk-lang
⁠GitHub Container Registry
  • ghcr.io/monkfromearth/monk-lang:latest
  • Pull: docker pull ghcr.io/monkfromearth/monk-lang

⁠Usage Examples

⁠Interactive REPL
# Ubuntu variant
docker run --rm -it monkfromearth/monk-lang

# Alpine variant (smaller)
docker run --rm -it monkfromearth/monk-lang:alpine

# With specific version
docker run --rm -it monkfromearth/monk-lang:v0.0.7
⁠Running Scripts
# Mount local directory with your scripts
docker run --rm -v "$(pwd)":/workspace -w /workspace monkfromearth/monk-lang monk run script.monk

# Pass script via stdin
cat script.monk | docker run --rm -i monkfromearth/monk-lang monk repl

# One-liner execution
echo 'show(42 + 8)' | docker run --rm -i monkfromearth/monk-lang monk repl
⁠Exploring Examples
# List available examples
docker run --rm monkfromearth/monk-lang ls /usr/local/share/monk/examples

# Run specific example
docker run --rm monkfromearth/monk-lang monk run /usr/local/share/monk/examples/07-functions/15_functions.monk

# Copy examples to host
docker run --rm -v "$(pwd)":/output monkfromearth/monk-lang sh -c "cp -r /usr/local/share/monk/examples /output/"

⁠Development & Testing

⁠Building Locally
# Clone the repository
git clone https://github.com/monkfromearth/monk-lang.git
cd monk-lang

# Build Ubuntu variant
docker build -t monk-lang .

# Build Alpine variant
docker build -f Dockerfile.alpine -t monk-lang:alpine .

# Multi-architecture build using buildx
./scripts/docker-build.sh --dry-run  # Show what would be built
./scripts/docker-build.sh --ubuntu   # Build only Ubuntu variant
./scripts/docker-build.sh --alpine   # Build only Alpine variant
./scripts/docker-build.sh --all      # Build all variants
⁠Testing Images
# Test basic functionality
docker run --rm monkfromearth/monk-lang monk --version

# Test REPL
echo 'show("Docker test successful!")' | docker run --rm -i monkfromearth/monk-lang monk repl

# Test example execution
docker run --rm monkfromearth/monk-lang monk run /usr/local/share/monk/examples/01-basic-language-features/00_basic_arithmetic.monk

# Test both variants
docker run --rm monkfromearth/monk-lang:ubuntu monk --version
docker run --rm monkfromearth/monk-lang:alpine monk --version

⁠Container Configuration

⁠Working Directory
  • Path: /usr/local/bin
  • Binary location: /usr/local/bin/monk
  • Examples: /usr/local/share/monk/examples
⁠User & Security
  • User: monk (UID: 1001, GID: 1001)
  • Group: monk
  • Security: Non-root execution for enhanced security
⁠Environment
  • PATH: Includes /usr/local/bin for direct monk access
  • Symlink: /usr/local/bin/monk-lang → /usr/local/bin/monk
⁠Default Command
CMD ["monk", "repl"]

⁠Advanced Usage

⁠Container Orchestration
# docker-compose.yml
version: '3.8'
services:
  monk-repl:
    image: monkfromearth/monk-lang:alpine
    container_name: monk-repl
    stdin_open: true
    tty: true
    volumes:
      - ./scripts:/workspace
    working_dir: /workspace
    command: monk repl

  monk-runner:
    image: monkfromearth/monk-lang:alpine
    volumes:
      - ./scripts:/workspace
    working_dir: /workspace
    command: monk run main.monk
⁠Kubernetes Deployment
apiVersion: v1
kind: Pod
metadata:
  name: monk-lang-pod
spec:
  containers:
  - name: monk-lang
    image: monkfromearth/monk-lang:alpine
    command: ["monk", "repl"]
    resources:
      requests:
        memory: "32Mi"
        cpu: "50m"
      limits:
        memory: "128Mi"
        cpu: "200m"
⁠Multi-Stage Build Integration
# Use Monk Lang in multi-stage builds
FROM monkfromearth/monk-lang:alpine as monk-builder
COPY scripts/ /workspace/
WORKDIR /workspace
RUN monk run build.monk

FROM alpine:3.21
COPY --from=monk-builder /workspace/output/ /app/
CMD ["/app/main"]

⁠Supported Architectures

All images support multiple architectures:

  • linux/amd64 (x86_64)
  • linux/arm64 (ARM64/AArch64)

Docker automatically pulls the correct architecture for your platform.

⁠Version History

VersionRelease DateUbuntu SizeAlpine SizeNotable Changes
v0.0.72025-01-01~120MB~40MBCI test fixes, Docker support
v0.0.62024-12-30~115MB~38MBStatic semantics, type system
v0.0.52024-12-25~110MB~35MBCore language features complete

⁠License

Monk Lang is released under the MIT License⁠.

⁠Support

For issues, questions, or contributions:

  1. Check the documentation⁠
  2. Search existing issues⁠
  3. Create a new issue⁠
  4. Join the community discussions

Tag summary

Content type

Image

Digest

sha256:349561604…

Size

67.2 MB

Last updated

about 1 year ago

docker pull monkfromearth/monk-lang