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
e363a266
Commit
e363a266
authored
Apr 14, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23697 from luxas/pause_multi_arch
Automatic merge from submit-queue Update the pause image to build for arm64 and ppc64le Fixes #22683
parents
1965c3cd
c214c766
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
37 deletions
+32
-37
Makefile
build/pause/Makefile
+32
-10
prepare.sh
build/pause/prepare.sh
+0
-27
No files found.
build/pause/Makefile
View file @
e363a266
...
...
@@ -14,18 +14,40 @@
.PHONY
:
build push
TAG
=
2.0
TAG
=
2.0
REGISTRY
?=
"gcr.io/google_containers"
ARCH
=
amd64
IMAGE
=
pause
# ARCH = arm
# IMAGE = pause-arm
# Architectures supported: amd64, arm, arm64 and ppc64le
ARCH
?=
amd64
GOLANG_VERSION
=
1.6
TEMP_DIR
:=
$(
shell
mktemp
-d
)
all
:
push-legacy-too
build
:
./prepare.sh
${
ARCH
}
docker build
-t
gcr.io/google_containers/
$(IMAGE)
:
$(TAG)
.
cp
pause.go Dockerfile
$(TEMP_DIR)
docker run -it -v $(TEMP_DIR)
:
/build golang:$(GOLANG_VERSION) /bin/bash -c
\
"cd /build && CGO_ENABLED=0 GOARM=6 GOARCH=$(ARCH) go build -a -installsuffix cgo -ldflags '-w' ./pause.go"
ifeq
($(ARCH),$(filter
$(ARCH),amd64
arm))
# Run goupx for amd64 and arm. The condition above is equal to 'if [[ $ARCH == "amd64" || $ARCH == "arm" ]]' in bash
docker run -it -v $(TEMP_DIR)
:
/build golang:$(GOLANG_VERSION) /bin/bash -c
\
"cd /build && apt-get update && apt-get install -y upx
\
&& go get github.com/pwaller/goupx && goupx pause"
endif
# And build the image
docker build -t $(REGISTRY)/pause-$(ARCH)
:
$(TAG) $(TEMP_DIR)
ifeq
($(ARCH),amd64)
docker tag -f $(REGISTRY)/pause-$(ARCH)
:
$(TAG) $(REGISTRY)/pause:$(TAG)
endif
push
:
build
gcloud docker
--server
=
gcr.io push
gcr.io/google_containers/
$(IMAGE
)
:
$(TAG)
push
:
build
gcloud docker
--server
=
gcr.io push
$(REGISTRY)
/pause-
$(ARCH
)
:
$(TAG)
all
:
push
push-legacy-too
:
push
ifeq
($(ARCH),amd64)
gcloud docker push $(REGISTRY)/pause
:
$(TAG)
endif
build/pause/prepare.sh
deleted
100755 → 0
View file @
1965c3cd
#!/bin/bash
# Copyright 2014 The Kubernetes Authors 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.
set
-e
set
-x
ARCH
=
$1
# Build the binary.
CGO_ENABLED
=
0
GOOS
=
linux
GOARCH
=
${
ARCH
}
godep go build
-a
-installsuffix
cgo
-ldflags
'-w'
./pause.go
# Run goupx to shrink binary size.
go get github.com/pwaller/goupx
goupx pause
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