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
c214c766
Commit
c214c766
authored
Apr 01, 2016
by
Lucas Käldström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the pause image to build for arm64 and ppc64le
parent
d41d5054
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 @
c214c766
...
@@ -14,18 +14,40 @@
...
@@ -14,18 +14,40 @@
.PHONY
:
build push
.PHONY
:
build push
TAG
=
2.0
TAG
=
2.0
REGISTRY
?=
"gcr.io/google_containers"
ARCH
=
amd64
# Architectures supported: amd64, arm, arm64 and ppc64le
IMAGE
=
pause
ARCH
?=
amd64
# ARCH = arm
GOLANG_VERSION
=
1.6
# IMAGE = pause-arm
TEMP_DIR
:=
$(
shell
mktemp
-d
)
all
:
push-legacy-too
build
:
build
:
./prepare.sh
${
ARCH
}
cp
pause.go Dockerfile
$(TEMP_DIR)
docker build
-t
gcr.io/google_containers/
$(IMAGE)
:
$(TAG)
.
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
push
:
build
gcloud docker
--server
=
gcr.io push
gcr.io/google_containers/
$(IMAGE
)
:
$(TAG)
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 @
d41d5054
#!/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