Sign inSign up

tordarus/gorunner

By tordarus

•Updated 13 days ago

Clone, build, and execute Go code in a lightweight Alpine container

Image
0

1.0K

tordarus/gorunner repository overview

⁠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
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:

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:

docker compose up

⁠Environment Variables

VariableRequiredDescription
GIT_REPOYesThe HTTPS Git URL of your Go project
GIT_REFOptionalBranch name, tag, or commit hash to checkout after clone (default: HEAD)
GIT_USERNAMEOptionalYour Git username (required for private repos)
GIT_TOKENOptionalA personal access token or password (required for private repos)
APP_PATHOptionalRelative path to the Go module directory inside the repo (default: .)
PACKAGESOptionalComma-separated list of packages to install with apk before execution

⁠Docker Hub

Pull the image from Docker Hub: tordarus/gorunner⁠

⁠Source Repository

View the source code: https://git.tordarus.net/tordarus/gorunner⁠

Found a bug or have an idea for improvement? Create an issue⁠ in the repository.

⁠License

MIT License – feel free to modify and use.

Tag summary

Content type

Image

Digest

sha256:158d07528…

Size

78.6 MB

Last updated

13 days ago

docker pull tordarus/gorunner