diff --git a/docker/Dockerfile b/docker/Dockerfile index af6eebe7..b98c9df8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -37,6 +37,9 @@ ENV SYNCTHING_ANDROID_PREBUILT 1 # Set location of go cache ENV GOCACHE /opt/gocache +# Set location of GOPATH to persist packages for module builds in GOPATH/pkg/mod +ENV GOPATH /opt/gopath + # Run prebuild script (will prebuild stuff into the image if env var is set) ADD prebuild.sh /opt/prebuild.sh RUN /opt/prebuild.sh diff --git a/docker/prebuild.sh b/docker/prebuild.sh index e2d8d5d1..b03505ce 100755 --- a/docker/prebuild.sh +++ b/docker/prebuild.sh @@ -33,7 +33,7 @@ for ARCH in arm x86 arm64; do GOOS=android GOARCH=$GOARCH go install -v std done -echo "Prepopulating gradle cache" +echo "Prepopulating gradle and go build/pkg cache" git clone https://github.com/syncthing/syncthing-android cd syncthing-android ./gradlew --no-daemon lint diff --git a/syncthing/build-syncthing.py b/syncthing/build-syncthing.py index f5bbb3bf..315da4cf 100644 --- a/syncthing/build-syncthing.py +++ b/syncthing/build-syncthing.py @@ -109,7 +109,6 @@ for target in BUILD_TARGETS: environ = os.environ.copy() environ.update({ - 'GOPATH': module_dir, 'GO111MODULE': 'on', 'CGO_ENABLED': '1', })