# ๐Ÿณ Go Builder & Runner Docker Image This Docker image is designed to **download**, **compile**, and **run** a Go program from a Git repository entirely at **container runtime**. It supports both public and private repositories and works seamlessly across multiple architectures. ๐Ÿ—๏ธ **Built on Alpine Linux** for a minimal, efficient footprint. --- ## โœ… Features * โœ… Clones a Go repository at runtime * โœ… Supports **private Git repositories** using `.netrc`-based auth * โœ… Builds and runs your Go application * โœ… Supports checking out a specific **branch, tag, or commit** via `GIT_REF` * โœ… Multi-architecture: `linux/amd64`, `linux/arm64`, `linux/arm/v7` * โœ… Minimal and reproducible container setup with Alpine Linux --- ## ๐Ÿงช Example Usage ### ๐Ÿš Docker CLI ```bash docker run --rm \ -e GIT_REPO=https://git.tordarus.net/tordarus/hello-world.git \ -e GIT_REF=main \ tordarus/gorunner:latest ```` ### ๐Ÿณ Docker Compose Create a `docker-compose.yml`: ```yaml version: "3.9" services: gorunner: image: tordarus/gorunner:latest environment: GIT_REPO: https://git.tordarus.net/tordarus/hello-world.git GIT_REF: main # Optional โ€“ specify branch, tag, or commit GIT_USERNAME: yourusername # Optional for public repos GIT_TOKEN: yourtoken # Optional for public repos APP_PATH: . # Optional โ€“ subdir of Go app PACKAGES: curl # Optional โ€“ comma-separated apk packages ``` Then run it with: ```bash docker compose up ``` --- ## ๐Ÿ”ง Environment Variables | Variable | Required | Description | | -------------- | -------- | ------------------------------------------------------------------------ | | `GIT_REPO` | โœ… Yes | The HTTPS Git URL of your Go project | | `GIT_REF` | Optional | Branch name, tag, or commit hash to checkout after clone (default: HEAD) | | `GIT_USERNAME` | Optional | Your Git username (required for private repos) | | `GIT_TOKEN` | Optional | A personal access token or password (required for private repos) | | `APP_PATH` | Optional | Relative path to the Go module directory inside the repo (default: `.`) | | `PACKAGES` | Optional | Comma-separated list of packages to install with `apk` before execution | --- ## ๐Ÿ“ฆ Docker Hub ๐Ÿ‘‰ Pull the image from Docker Hub: **[tordarus/gorunner](https://hub.docker.com/r/tordarus/gorunner)** --- ## ๐Ÿ”— Source Repository View the source code: ๐Ÿ‘‰ [https://git.tordarus.net/tordarus/gorunner](https://git.tordarus.net/tordarus/gorunner) Found a bug or have an idea for improvement? ๐Ÿ› ๏ธ [Create an issue](https://git.tordarus.net/tordarus/gorunner/issues) in the repository. --- ## ๐Ÿ“„ License MIT License โ€“ feel free to modify and use.