Files
postgres-operator/docker/build_operator.sh
T
Felix Kunde df3224730f Update to Go 1.26.4, build runners and go.mod depedencies (#3108)
* update golang and dependencies
* fix incorrect log formatting
* clean mod chache and introduce GOARCH in Dockerfile (choose dynamically)
* remove GO111MODULE mentions
* bump github actions from v2 to v3
* bump docker runners to v7
* use extra event store for backwards compatibility with existing codebase
* updated generated opconfig api
2026-06-23 13:35:53 +02:00

32 lines
590 B
Bash

#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
arch=$(dpkg --print-architecture)
set -ex
# Install dependencies
apt-get update
apt-get install -y wget
(
cd /tmp
wget -q "https://storage.googleapis.com/golang/go1.26.4.linux-${arch}.tar.gz" -O go.tar.gz
tar -xf go.tar.gz
mv go /usr/local
ln -s /usr/local/go/bin/go /usr/bin/go
go version
)
# Build
export PATH="$PATH:$HOME/go/bin"
export GOPATH="$HOME/go"
mkdir -p build
go clean -cache -modcache
go mod vendor
CGO_ENABLED=0 go build -o build/postgres-operator -v -ldflags "$OPERATOR_LDFLAGS" cmd/main.go