Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
aa045f78
Commit
aa045f78
authored
Sep 14, 2016
by
Lucas Käldström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a patched golang version for building linux/arm, fixes kube-apiserver
parent
f89d5006
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
6 deletions
+25
-6
Dockerfile
build/build-image/Dockerfile
+2
-2
Dockerfile
build/build-image/cross/Dockerfile
+14
-1
VERSION
build/build-image/cross/VERSION
+1
-1
CL28857-go1.7.1-luxas.patch
...ld-image/cross/golang-patches/CL28857-go1.7.1-luxas.patch
+0
-0
golang.sh
hack/lib/golang.sh
+8
-2
No files found.
build/build-image/Dockerfile
View file @
aa045f78
...
...
@@ -18,8 +18,8 @@ FROM gcr.io/google_containers/kube-cross:KUBE_BUILD_IMAGE_CROSS_TAG
# Mark this as a kube-build container
RUN
touch
/kube-build-image
# T
O
run as non-root we sometimes need to rebuild go stdlib packages.
RUN
chmod
-R
a+rwx /usr/local/go/pkg
# T
o
run as non-root we sometimes need to rebuild go stdlib packages.
RUN
chmod
-R
a+rwx /usr/local/go/pkg
${
K8S_PATCHED_GOROOT
}
/pkg
# The kubernetes source is expected to be mounted here. This will be the base
# of operations.
...
...
build/build-image/cross/Dockerfile
View file @
aa045f78
...
...
@@ -35,7 +35,7 @@ RUN for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${plat
# Install g++, then download and install protoc for generating protobuf output
RUN
apt-get update
\
&&
apt-get
install
-y
g++ rsync apt-utils file
\
&&
apt-get
install
-y
g++ rsync apt-utils file
patch
\
&&
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
RUN
mkdir
-p
/usr/local/src/protobuf
\
...
...
@@ -77,3 +77,16 @@ RUN export ETCD_VERSION=v2.2.1; \
&&
cd
/usr/local/src/etcd
\
&&
curl
-fsSL
https://github.com/coreos/etcd/releases/download/
${
ETCD_VERSION
}
/etcd-
${
ETCD_VERSION
}
-linux-amd64
.tar.gz |
tar
-xz
\
&&
ln
-s
../src/etcd/etcd-
${
ETCD_VERSION
}
-linux-amd64
/etcd /usr/local/bin/
# TODO: Remove the patched GOROOT when we have an official golang that has a working arm and ppc64le linker
ENV
K8S_PATCHED_GOLANG_VERSION=1.7.1 \
K8S_PATCHED_GOROOT=/usr/local/go_k8s_patched
RUN
mkdir
-p
${
K8S_PATCHED_GOROOT
}
\
&&
curl
-sSL
https://github.com/golang/go/archive/go
${
K8S_PATCHED_GOLANG_VERSION
}
.tar.gz |
tar
-xz
-C
${
K8S_PATCHED_GOROOT
}
--strip-components
=
1
COPY
golang-patches/CL28857-go1.7.1-luxas.patch ${K8S_PATCHED_GOROOT}/
RUN
cd
${
K8S_PATCHED_GOROOT
}
\
&&
patch
-p1
< CL28857-go1.7.1-luxas.patch
\
&&
cd
src
\
&&
GOROOT_FINAL
=
${
K8S_PATCHED_GOROOT
}
GOROOT_BOOTSTRAP
=
/usr/local/go ./make.bash
\
&&
for
platform
in
linux/arm
;
do
GOOS
=
${
platform
%/*
}
GOARCH
=
${
platform
##*/
}
GOROOT
=
${
K8S_PATCHED_GOROOT
}
go
install
std
;
done
build/build-image/cross/VERSION
View file @
aa045f78
v1.6.3-
6
v1.6.3-
7
build/build-image/cross/golang-patches/CL28857-go1.7.1-luxas.patch
0 → 100644
View file @
aa045f78
This diff is collapsed.
Click to expand it.
hack/lib/golang.sh
View file @
aa045f78
...
...
@@ -100,7 +100,6 @@ else
linux/amd64
darwin/amd64
windows/amd64
linux/arm
)
fi
...
...
@@ -226,7 +225,7 @@ kube::golang::current_platform() {
# for that platform.
kube::golang::set_platform_envs
()
{
[[
-n
${
1
-
}
]]
||
{
kube::log::error_exit
"!!! Internal error.
No platform set in kube::golang::set_platform_envs"
kube::log::error_exit
"!!! Internal error. No platform set in kube::golang::set_platform_envs"
}
export
GOOS
=
${
platform
%/*
}
...
...
@@ -240,6 +239,7 @@ kube::golang::set_platform_envs() {
if
[[
${
platform
}
==
"linux/arm"
]]
;
then
export
CGO_ENABLED
=
1
export
CC
=
arm-linux-gnueabi-gcc
export
GOROOT
=
${
K8S_PATCHED_GOROOT
}
elif
[[
${
platform
}
==
"linux/arm64"
]]
;
then
export
CGO_ENABLED
=
1
export
CC
=
aarch64-linux-gnu-gcc
...
...
@@ -253,6 +253,7 @@ kube::golang::set_platform_envs() {
kube::golang::unset_platform_envs
()
{
unset
GOOS
unset
GOARCH
unset
GOROOT
unset
CGO_ENABLED
unset
CC
}
...
...
@@ -477,6 +478,11 @@ kube::golang::build_binaries_for_platform() {
kube::golang::fallback_if_stdlib_not_installable
;
fi
# TODO: Remove this temporary workaround when we have the official golang linker working
if
[[
${
platform
}
==
"linux/arm"
]]
;
then
gogcflags
=
"
${
gogcflags
}
-largemodel"
fi
if
[[
-n
${
use_go_build
:-}
]]
;
then
kube::log::progress
" "
for
binary
in
"
${
statics
[@]
:+
${
statics
[@]
}}
"
;
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment