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
a8824459
Commit
a8824459
authored
Oct 15, 2018
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use sudo only when not already root
parent
9e4fa149
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
4 deletions
+14
-4
Makefile
build/debian-base/Makefile
+3
-1
Makefile
build/debian-hyperkube-base/Makefile
+3
-1
Makefile
build/debian-iptables/Makefile
+3
-1
image-util.sh
test/images/image-util.sh
+5
-1
No files found.
build/debian-base/Makefile
View file @
a8824459
...
...
@@ -27,6 +27,8 @@ ALL_ARCH = amd64 arm arm64 ppc64le s390x
TEMP_DIR
:=
$(
shell
mktemp
-d
)
QEMUVERSION
=
v2.9.1
SUDO
=
$
(
if
$
(
filter 0,
$(
shell
id
-u
)
)
,,sudo
)
# This option is for running docker manifest command
export
DOCKER_CLI_EXPERIMENTAL
:=
enabled
...
...
@@ -80,7 +82,7 @@ ifeq ($(ARCH),amd64)
else
# When cross-building, only the placeholder "CROSS_BUILD_" should be removed
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
sudo
../../third_party/multiarch/qemu-user-static/register/register.sh
--reset
$(SUDO)
../../third_party/multiarch/qemu-user-static/register/register.sh
--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)
# Ensure we don't get surprised by umask settings
chmod
0755
$(TEMP_DIR)
/qemu-
$(QEMUARCH)
-static
...
...
build/debian-hyperkube-base/Makefile
View file @
a8824459
...
...
@@ -33,6 +33,8 @@ CNI_TARBALL=cni-plugins-$(ARCH)-$(CNI_VERSION).tgz
# This option is for running docker manifest command
export
DOCKER_CLI_EXPERIMENTAL
:=
enabled
SUDO
=
$
(
if
$
(
filter 0,
$(
shell
id
-u
)
)
,,sudo
)
.PHONY
:
all build push clean all-build all-push-images all-push push-manifest
all
:
all-push
...
...
@@ -74,7 +76,7 @@ endif
ifneq
($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
sudo
../../third_party/multiarch/qemu-user-static/register/register.sh
--reset
$(SUDO)
../../third_party/multiarch/qemu-user-static/register/register.sh
--reset
endif
docker build --pull -t $(IMAGE)-$(ARCH)
:
$(TAG) $(TEMP_DIR)
rm
-rf
$(TEMP_DIR)
...
...
build/debian-iptables/Makefile
View file @
a8824459
...
...
@@ -26,13 +26,15 @@ BASEIMAGE?=k8s.gcr.io/debian-base-$(ARCH):0.3.2
# This option is for running docker manifest command
export
DOCKER_CLI_EXPERIMENTAL
:=
enabled
SUDO
=
$
(
if
$
(
filter 0,
$(
shell
id
-u
)
)
,,sudo
)
build
:
cp
./
*
$(TEMP_DIR)
cd
$(TEMP_DIR)
&&
sed
-i
"s|BASEIMAGE|
$(BASEIMAGE)
|g"
Dockerfile
ifneq
($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
sudo
../../third_party/multiarch/qemu-user-static/register/register.sh
--reset
$(SUDO)
../../third_party/multiarch/qemu-user-static/register/register.sh
--reset
endif
docker build --pull -t $(IMAGE)-$(ARCH)
:
$(TAG) $(TEMP_DIR)
...
...
test/images/image-util.sh
View file @
a8824459
...
...
@@ -84,7 +84,11 @@ build() {
${
SED
}
-i
"s|QEMUARCH|
${
QEMUARCHS
[
$arch
]
}
|g"
Dockerfile
# Register qemu-*-static for all supported processors except the current one
echo
"Registering qemu-*-static binaries in the kernel"
sudo
"
${
KUBE_ROOT
}
/third_party/multiarch/qemu-user-static/register/register.sh"
--reset
local sudo
=
""
if
[[
$(
id
-u
)
!=
0
]]
;
then
sudo
=
sudo
fi
"
${
sudo
}
"
"
${
KUBE_ROOT
}
/third_party/multiarch/qemu-user-static/register/register.sh"
--reset
curl
-sSL
https://github.com/multiarch/qemu-user-static/releases/download/
${
QEMUVERSION
}
/x86_64_qemu-
${
QEMUARCHS
[
$arch
]
}
-static
.tar.gz |
tar
-xz
-C
${
temp_dir
}
# Ensure we don't get surprised by umask settings
chmod
0755
"
${
temp_dir
}
/qemu-
${
QEMUARCHS
[
$arch
]
}
-static"
...
...
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