summaryrefslogtreecommitdiff
path: root/hack/make-rules
diff options
context:
space:
mode:
authorgy95 <guoyao17@huawei.com>2022-03-30 14:51:00 +0800
committergy95 <guoyao17@huawei.com>2022-04-06 10:59:42 +0800
commit0bd2d508040b774f5678e318fe7747dadc7d3599 (patch)
tree481e001e5766d146d5aee04955f65889da482224 /hack/make-rules
parentMerge pull request #3750 from vincentgoat/optimize_sendobj (diff)
downloadkubeedge-0bd2d508040b774f5678e318fe7747dadc7d3599.tar.gz
support compile binaries with golang images
Signed-off-by: gy95 <guoyao17@huawei.com>
Diffstat (limited to 'hack/make-rules')
-rwxr-xr-xhack/make-rules/build_with_container.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/hack/make-rules/build_with_container.sh b/hack/make-rules/build_with_container.sh
new file mode 100755
index 000000000..80fb3fb03
--- /dev/null
+++ b/hack/make-rules/build_with_container.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+###
+#Copyright 2022 The KubeEdge Authors.
+#
+#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 -o errexit
+set -o nounset
+set -o pipefail
+
+KUBEEDGE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
+MOUNTPATH="${MOUNTPATH:-/kubeedge}"
+KUBEEDGE_BUILD_IMAGE=${KUBEEDGE_BUILD_IMAGE:-"kubeedge/build-tools"}
+
+set -x
+docker run --rm -v ${KUBEEDGE_ROOT}:${MOUNTPATH} -w ${MOUNTPATH} ${KUBEEDGE_BUILD_IMAGE} "$@"
+set +x