This repository was archived by the owner on Oct 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
components/engine/hack/dockerfile/install Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,15 @@ install_containerd() {
1414
1515 (
1616
17- if [ " $1 " == " static" ]; then
18- export BUILDTAGS=' static_build netgo'
19- export EXTRA_FLAGS=' -buildmod pie'
20- export EXTRA_LDFLAGS=' -extldflags "-fno-PIC -static"'
17+ export BUILDTAGS=' static_build netgo'
18+ export EXTRA_FLAGS=' -buildmode=pie'
19+ export EXTRA_LDFLAGS=' -extldflags "-fno-PIC -static"'
20+
21+ # Reset build flags to nothing if we want a dynbinary
22+ if [ " $1 " == " dynamic" ]; then
23+ export BUILDTAGS=' '
24+ export EXTRA_FLAGS=' '
25+ export EXTRA_LDFLAGS=' '
2126 fi
2227
2328 make
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ install_proxy() {
2323
2424install_proxy_dynamic () {
2525 export PROXY_LDFLAGS=" -linkmode=external" install_proxy
26+ export BUILD_MODE=" -buildmode=pie"
2627 _install_proxy
2728}
2829
@@ -31,7 +32,7 @@ _install_proxy() {
3132 git clone https://github.com/docker/libnetwork.git " $GOPATH /src/github.com/docker/libnetwork"
3233 cd " $GOPATH /src/github.com/docker/libnetwork"
3334 git checkout -q " $LIBNETWORK_COMMIT "
34- go build -buildmode=pie -ldflags=" $PROXY_LDFLAGS " -o ${PREFIX} /docker-proxy github.com/docker/libnetwork/cmd/proxy
35+ go build $BUILD_MODE -ldflags=" $PROXY_LDFLAGS " -o ${PREFIX} /docker-proxy github.com/docker/libnetwork/cmd/proxy
3536}
3637
3738
Original file line number Diff line number Diff line change @@ -11,7 +11,12 @@ install_runc() {
1111 git clone https://github.com/opencontainers/runc.git " $GOPATH /src/github.com/opencontainers/runc"
1212 cd " $GOPATH /src/github.com/opencontainers/runc"
1313 git checkout -q " $RUNC_COMMIT "
14- make BUILDTAGS=" $RUNC_BUILDTAGS " $1
14+ if [ -z " $1 " ]; then
15+ target=static
16+ else
17+ target=" $1 "
18+ fi
19+ make BUILDTAGS=" $RUNC_BUILDTAGS " " $target "
1520 mkdir -p ${PREFIX}
1621 cp runc ${PREFIX} /docker-runc
1722}
You can’t perform that action at this time.
0 commit comments