kgrv/golang

By kgrv

Updated 13 days ago

A mimalloc static compiled Go toolchain.

Image
Languages & frameworks
0

3.9K

kgrv/golang repository overview

DESCRIPTION

A mimalloc static compiled golang toolchain.

SUPPORTED TAGS

SUPPORTED ARCHITECTURES

OS/ARCHDescription
linux/amd6464-bit x86 architecture for Linux operating systems
linux/arm6464-bit ARM architecture for Linux operating systems

PARAMETERS

TypeContainerFunction
EnvironmentCGO_ENABLEDOptional Static Compilation
EnvironmentEUIDOptional Effective User ID
EnvironmentEGIDOptional Effective Group ID
EnvironmentUMASKOptional Default permissions
EnvironmentSUGGESTOptional Set suggestion messages
Volume/mntOptional Bind mount volume

OVERVIEW

Static Compilation

CGO_ENABLED=0 by default to enable static compilation.

Mimalloc

  • musl struggles with multi-threaded performance compared to glibc
  • mimalloc patched libc.a to replace musl malloc

User / Group ID

  • EUID / EGID environment variables
  • mini:mini as default

Mask

  • UMASK defaults to 0022

Suggestion

  • SUGGEST defaults to true

Package Management

  • apk permitted for mini with doas

USAGE

Dockerfile

FROM kgrv/golang AS build
Static Cross-Compilation

Set GOARCH and GOOS for target

Example

build stage from kgrv/sftpgo:

FROM --platform=${BUILDPLATFORM} kgrv/golang AS build
ARG TARGETARCH
ARG TARGETOS
ARG GOARCH="${TARGETARCH}"
ARG GOOS="${TARGETOS}"
...

Docker CLI

docker run -it kgrv/golang
Start container with bind mount
docker run -it -v $(pwd):/mnt kgrv/golang
Start container with UID / GID

Important

Argument --user is not supported, please use EUID/EGID.

docker run -it -e EUID=$(id -u) -e EGID=$(id -g) kgrv/golang
Start container as ROOT
docker run -it kgrv/golang --BECOME_ROOT
Install packages
doas apk add PACKAGE

Tag summary

Content type

Image

Digest

sha256:866404b6d

Size

67.9 MB

Last updated

13 days ago

docker pull kgrv/golang