Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit f4035e8

Browse files
committed
bugfix: set GO111MODULE to on when use docker build
Signed-off-by: Starnop <[email protected]>
1 parent 3ab5e9d commit f4035e8

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

cmd/supernode/app/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package app
1818

19-
import "C"
2019
import (
2120
"fmt"
2221
"os"

hack/build.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ USE_DOCKER=${USE_DOCKER:-"0"}
1818

1919
create-dirs() {
2020
cd "${BUILD_SOURCE_HOME}" || return
21-
if [ "${GOOS}" == "darwin" ] && [ "1" == "${USE_DOCKER}" ]
22-
then
23-
BUILD_PATH=bin
24-
fi
2521
mkdir -p .go/src/${PKG} .go/bin .cache
2622
mkdir -p "${BUILD_PATH}"
2723
}
@@ -58,11 +54,13 @@ build-docker() {
5854
-v "$(pwd)"/.cache:/.cache \
5955
-e GOOS="${GOOS}" \
6056
-e GOARCH="${GOARCH}" \
61-
-e CGO_ENABLED=1 \
57+
-e CGO_ENABLED=0 \
58+
-e GO111MODULE=on \
59+
-e GOPROXY=https://goproxy.io \
6260
-w /go/src/${PKG} \
6361
${BUILD_IMAGE} \
64-
go install -v -pkgdir /go/pkg -ldflags "${LDFLAGS}" ./cmd/"$2"
65-
echo "BUILD: dfget in ${BUILD_SOURCE_HOME}/${BUILD_PATH}/$1"
62+
go build -o "/go/bin/$1" -ldflags "${LDFLAGS}" ./cmd/"$2"
63+
echo "BUILD: $1 in ${BUILD_SOURCE_HOME}/${BUILD_PATH}/$1"
6664
}
6765

6866
build-dfdaemon-docker(){

0 commit comments

Comments
 (0)