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
6452b0fe
Commit
6452b0fe
authored
Oct 21, 2014
by
Johan Euphrosine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: add kube-build:cross base
parent
521f145f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
12 deletions
+43
-12
Dockerfile
build/build-image/Dockerfile
+1
-7
Dockerfile
build/build-image/cross/Dockerfile
+25
-0
common.sh
build/common.sh
+17
-5
No files found.
build/build-image/Dockerfile
View file @
6452b0fe
...
@@ -14,15 +14,9 @@
...
@@ -14,15 +14,9 @@
# This file creates a standard build environment for building Kubernetes
# This file creates a standard build environment for building Kubernetes
FROM
golang:1.3
FROM
kube-build:cross
MAINTAINER
Joe Beda <jbeda@google.com>
MAINTAINER
Joe Beda <jbeda@google.com>
ENV
KUBE_CROSSPLATFORMS \
linux/386 linux/arm \
darwin/amd64 darwin/386
RUN
cd
/usr/src/go/src
&&
for
platform
in
${
KUBE_CROSSPLATFORMS
}
;
do
GOOS
=
${
platform
%/*
}
GOARCH
=
${
platform
##*/
}
./make.bash
--no-clean
;
done
# (set an explicit GOARM of 5 for maximum compatibility)
# (set an explicit GOARM of 5 for maximum compatibility)
ENV
GOARM 5
ENV
GOARM 5
ENV
GOOS linux
ENV
GOOS linux
...
...
build/build-image/cross/Dockerfile
0 → 100644
View file @
6452b0fe
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file creates a standard build environment for building cross
# platform go binary for the architecture kubernetes cares about.
FROM
golang:1.3
MAINTAINER
Joe Beda <jbeda@google.com>
ENV
KUBE_CROSSPLATFORMS \
linux/386 linux/arm \
darwin/amd64 darwin/386
RUN
cd
/usr/src/go/src
&&
for
platform
in
${
KUBE_CROSSPLATFORMS
}
;
do
GOOS
=
${
platform
%/*
}
GOARCH
=
${
platform
##*/
}
./make.bash
--no-clean
;
done
build/common.sh
View file @
6452b0fe
...
@@ -46,6 +46,8 @@ readonly KUBE_BUILD_IMAGE_REPO=kube-build
...
@@ -46,6 +46,8 @@ readonly KUBE_BUILD_IMAGE_REPO=kube-build
# KUBE_BUILD_IMAGE_TAG=<hash>
# KUBE_BUILD_IMAGE_TAG=<hash>
# KUBE_BUILD_IMAGE="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_TAG}"
# KUBE_BUILD_IMAGE="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_TAG}"
# KUBE_BUILD_CONTAINER_NAME=kube-build-<hash>
# KUBE_BUILD_CONTAINER_NAME=kube-build-<hash>
readonly
KUBE_BUILD_IMAGE_CROSS_TAG
=
cross
readonly
KUBE_BUILD_IMAGE_CROSS
=
"
${
KUBE_BUILD_IMAGE_REPO
}
:
${
KUBE_BUILD_IMAGE_CROSS_TAG
}
"
readonly
KUBE_GO_PACKAGE
=
"github.com/GoogleCloudPlatform/kubernetes"
readonly
KUBE_GO_PACKAGE
=
"github.com/GoogleCloudPlatform/kubernetes"
...
@@ -220,8 +222,8 @@ function kube::build::build_image_built() {
...
@@ -220,8 +222,8 @@ function kube::build::build_image_built() {
kube::build::docker_image_exists
"
${
KUBE_BUILD_IMAGE_REPO
}
"
"
${
KUBE_BUILD_IMAGE_TAG
}
"
kube::build::docker_image_exists
"
${
KUBE_BUILD_IMAGE_REPO
}
"
"
${
KUBE_BUILD_IMAGE_TAG
}
"
}
}
function
kube::build::ensure_golang
_cross
()
{
function
kube::build::ensure_golang
()
{
kube::build::docker_image_exists golang
cross
||
{
kube::build::docker_image_exists golang
1.3
||
{
[[
${
KUBE_SKIP_CONFIRMATIONS
}
=
~ ^[yY]
$
]]
||
{
[[
${
KUBE_SKIP_CONFIRMATIONS
}
=
~ ^[yY]
$
]]
||
{
echo
"You don't have a local copy of the golang:cross docker image. This image is 1.8GB."
echo
"You don't have a local copy of the golang:cross docker image. This image is 1.8GB."
read
-p
"Download it now? [y/n] "
-n
1
-r
read
-p
"Download it now? [y/n] "
-n
1
-r
...
@@ -232,8 +234,8 @@ function kube::build::ensure_golang_cross() {
...
@@ -232,8 +234,8 @@ function kube::build::ensure_golang_cross() {
}
}
}
}
echo
"+++ Pulling docker image: golang:
cross
"
echo
"+++ Pulling docker image: golang:
1.3
"
docker pull golang:
cross
docker pull golang:
1.3
}
}
}
}
...
@@ -255,7 +257,7 @@ function kube::build::build_image() {
...
@@ -255,7 +257,7 @@ function kube::build::build_image() {
third_party
third_party
)
)
kube::build::
ensure_golang
_cross
kube::build::
build_image
_cross
mkdir
-p
"
${
build_context_dir
}
"
mkdir
-p
"
${
build_context_dir
}
"
tar
czf
"
${
build_context_dir
}
/kube-source.tar.gz"
"
${
source
[@]
}
"
tar
czf
"
${
build_context_dir
}
/kube-source.tar.gz"
"
${
source
[@]
}
"
...
@@ -266,6 +268,16 @@ EOF
...
@@ -266,6 +268,16 @@ EOF
kube::build::docker_build
"
${
KUBE_BUILD_IMAGE
}
"
"
${
build_context_dir
}
"
kube::build::docker_build
"
${
KUBE_BUILD_IMAGE
}
"
"
${
build_context_dir
}
"
}
}
# Build the kubernetes golang cross base image.
function
kube::build::build_image_cross
()
{
kube::build::ensure_golang
local
-r
build_context_dir
=
"
${
LOCAL_OUTPUT_ROOT
}
/images/
${
KUBE_BUILD_IMAGE
}
/cross"
mkdir
-p
"
${
build_context_dir
}
"
cp
build/build-image/cross/Dockerfile
${
build_context_dir
}
/Dockerfile
kube::build::docker_build
"
${
KUBE_BUILD_IMAGE_CROSS
}
"
"
${
build_context_dir
}
"
}
# Builds the runtime image. Assumes that the appropriate binaries are already
# Builds the runtime image. Assumes that the appropriate binaries are already
# built and in _output/build/.
# built and in _output/build/.
function
kube::build::run_image
()
{
function
kube::build::run_image
()
{
...
...
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