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
0dee9f15
Commit
0dee9f15
authored
Aug 09, 2018
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only register qemu-user-static when necessary.
Also, don't re-download qemu-ARCH-static binaries for debian-iptables
parent
92fc7f18
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
28 deletions
+7
-28
Makefile
build/debian-hyperkube-base/Makefile
+2
-0
Dockerfile
build/debian-iptables/Dockerfile
+0
-4
Makefile
build/debian-iptables/Makefile
+3
-24
Makefile
cluster/images/hyperkube/Makefile
+2
-0
No files found.
build/debian-hyperkube-base/Makefile
View file @
0dee9f15
...
...
@@ -51,8 +51,10 @@ endif
mkdir
-p
${TEMP_DIR}/cni-bin/bin
tar
-xz
-C
${TEMP_DIR}/cni-bin/bin
-f
"cni-tars/${CNI_TARBALL}"
ifneq
($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static
:
register --reset
endif
docker build --pull -t $(REGISTRY)/$(IMAGE)-$(ARCH)
:
$(TAG) $(TEMP_DIR)
rm
-rf
$(TEMP_DIR)
...
...
build/debian-iptables/Dockerfile
View file @
0dee9f15
...
...
@@ -14,10 +14,6 @@
FROM
BASEIMAGE
# If we're building for another architecture than amd64, the CROSS_BUILD_ placeholder is removed so e.g. CROSS_BUILD_COPY turns into COPY
# If we're building normally, for amd64, CROSS_BUILD lines are removed
CROSS_BUILD_COPY qemu-ARCH-static /usr/bin/
RUN
clean-install
\
conntrack
\
ebtables
\
...
...
build/debian-iptables/Makefile
View file @
0dee9f15
...
...
@@ -19,37 +19,16 @@ IMAGE=debian-iptables
TAG
=
v10.1
ARCH
?=
amd64
TEMP_DIR
:=
$(
shell
mktemp
-d
)
QEMUVERSION
=
v2.9.1
ifeq
($(ARCH),arm)
QEMUARCH
=
arm
endif
ifeq
($(ARCH),arm64)
QEMUARCH
=
aarch64
endif
ifeq
($(ARCH),ppc64le)
QEMUARCH
=
ppc64le
endif
ifeq
($(ARCH),s390x)
QEMUARCH
=
s390x
endif
BASEIMAGE
=
k8s.gcr.io/debian-base-
$(ARCH)
:0.3.1
build
:
cp
./
*
$(TEMP_DIR)
cd
$(TEMP_DIR)
&&
sed
-i
"s|BASEIMAGE|
$(BASEIMAGE)
|g"
Dockerfile
cd
$(TEMP_DIR)
&&
sed
-i
"s|ARCH|
$(QEMUARCH)
|g"
Dockerfile
ifeq
($(ARCH),amd64)
# When building "normally" for amd64, remove the whole line, it has no part in the amd64 image
cd
$(TEMP_DIR)
&&
sed
-i
"/CROSS_BUILD_/d"
Dockerfile
else
# When cross-building, only the placeholder "CROSS_BUILD_" should be removed
# Register /usr/bin/qemu-ARCH-static as the handler for ARM binaries in the kernel
ifneq
($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static
:
register --reset
curl
-sSL
https://github.com/multiarch/qemu-user-static/releases/download/
$(QEMUVERSION)
/x86_64_qemu-
$(QEMUARCH)
-static
.tar.gz |
tar
-xz
-C
$(TEMP_DIR)
cd
$(TEMP_DIR)
&&
sed
-i
"s/CROSS_BUILD_//g"
Dockerfile
endif
docker build --pull -t $(REGISTRY)/$(IMAGE)-$(ARCH)
:
$(TAG) $(TEMP_DIR)
...
...
cluster/images/hyperkube/Makefile
View file @
0dee9f15
...
...
@@ -39,8 +39,10 @@ endif
cd
${TEMP_DIR}
&&
sed
-i.back
"s|BASEIMAGE|${BASEIMAGE}|g"
Dockerfile
ifneq
($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static
:
register --reset
endif
docker build --pull -t ${REGISTRY}/hyperkube-${ARCH}
:
${VERSION} ${TEMP_DIR}
rm
-rf
"
${
TEMP_DIR
}
"
...
...
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