Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a custom Go build with netpoller fixes #806

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions cmd/bigsky/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,47 @@
#
# podman build -f ./cmd/bigsky/Dockerfile -t bigsky .

FROM golang:1.23.3-bookworm AS custom-go
RUN apt update && apt install -y build-essential make git

# Git config
RUN git config --global user.email "automated_action_runner@github"
RUN git config --global user.name "automated_action_runner"

# Clone go source
RUN git clone https://go.googlesource.com/go /gosource

WORKDIR /gosource

# Checkout go version 1.23.3
RUN git checkout go1.23.3

# Cherry pick the CL
RUN git fetch https://go.googlesource.com/go refs/changes/97/564197/1 && git cherry-pick FETCH_HEAD

WORKDIR /gosource/src

# Build go
RUN ./all.bash

# Copy the artifacts to /export
RUN mkdir -p /export
RUN cp /gosource/bin/go /export/go


### Compile stage
FROM golang:1.22-alpine3.19 AS build-env
RUN apk add --no-cache build-base make git
FROM custom-go AS build-env

ADD . /dockerbuild
WORKDIR /dockerbuild

# timezone data for alpine builds
ENV GOEXPERIMENT=loopvar
RUN GIT_VERSION=$(git describe --tags --long --always) && \
go build -tags timetzdata -o /bigsky ./cmd/bigsky
/export/go build -tags timetzdata -o /bigsky ./cmd/bigsky

### Build Frontend stage
FROM node:18-alpine as web-builder
FROM node:18-alpine AS web-builder

WORKDIR /app

Expand Down
24 changes: 24 additions & 0 deletions cmd/bigsky/custom_go.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.23.3-alpine3.19 AS custom-go
RUN apk add --no-cache build-base make git

# Git config
RUN git config --global user.email "automated_action_runner@github"
RUN git config --global user.name "automated_action_runner"

# Clone go source
RUN git clone https://go.googlesource.com/go /gosource

WORKDIR /gosource

# Checkout go version 1.23.3
RUN git checkout go1.23.3

# Cherry pick the CL
RUN git fetch https://go.googlesource.com/go refs/changes/97/564197/1 && git cherry-pick FETCH_HEAD

# Build go
RUN ./src/all.bash

# Copy the artifacts to /export
RUN mkdir -p /export
RUN cp /gosource/bin/go /export/go
Loading