Skip to content

Revisit the Go Std Library Install Step in kubecross Dockerfile #2706

Open
@jeremyrickard

Description

@jeremyrickard

Currently in the kubecross Dockerfile, we precompile the standard library for a number of platforms:

ENV KUBE_CROSSPLATFORMS \
  linux/386 \
  linux/arm linux/arm64 \
  linux/ppc64le \
  linux/s390x \
  darwin/amd64 darwin/386 \
  windows/amd64 windows/386

We only do this when the targetArch is amd64:

RUN targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') \
    && if [ ${targetArch} = "amd64" ]; then \
    for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} go install std; done \
    && go clean -cache; \
fi

This was likely done as a way to improve efficiency with amd64 build hosts, but there are a number of arm64 platforms now that we should consider. We should also validate if this is actually useful, or if we end up recompiling the std lib anyway due to the different build flags and modes (cgo vs non-cgo) in use. If it's useful, we should consider the list of platforms and if the current conditional to only do this on amd64 is sufficient.

Removing this current step could reduce the overall size of the kubecross images and would be positive, if we don't need to do it.

/kind cleanup
/sig release
/area release-eng

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/release-engIssues or PRs related to the Release Engineering subprojectkind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.needs-prioritysig/releaseCategorizes an issue or PR as relevant to SIG Release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions