Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 860 Bytes

File metadata and controls

46 lines (31 loc) · 860 Bytes

Building Go 1.27 from source

The Gofu project requires Go 1.27+ for generic methods on generic types. If your system only has Go 1.26, you can build 1.27 inside a container.

Dockerfile

FROM golang:1.26-trixie AS builder

RUN apt-get update && apt-get install -y \
    git \
    build-essential \
 && rm -rf /var/lib/apt/lists/*

RUN git clone --depth=1 https://go.googlesource.com/go /tmp/go-src

RUN rm -rf /go/*

RUN mv /tmp/go-src/* /go/

RUN mv /tmp/go-src/.git /go/

WORKDIR /go/src

RUN ./make.bash

Build script

#!/bin/bash
podman build -t go-builder .
cid=$(podman create go-builder)
podman cp "$cid:/go" ./go

Replace podman with docker if using Docker. The ./go directory will contain the Go 1.27 installation.

Usage

export PATH="$PWD/go/bin:$PATH"
go version  # should show go1.27...