summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorJean-Philippe Roemer <jp@roemer.im>2016-05-11 18:11:59 +0100
committerUnknwon <u@gogs.io>2016-05-11 13:11:59 -0400
commitbcd4adb3a0b59581ee3ddca2c31ae8d339b92cfd (patch)
tree741f168d3dedb51a62b517af58e15023034f6092 /docker
parentbf5faf76eb0fde7e4dabcae84d0c153f6e72db48 (diff)
downloadgitea-bcd4adb3a0b59581ee3ddca2c31ae8d339b92cfd.tar.gz
gitea-bcd4adb3a0b59581ee3ddca2c31ae8d339b92cfd.zip
Update docker/build.sh script to use glide & make (#3079)
* docker: update build script to use glide + make - docker/build.sh will now use glide to fetch dependencies - glide is built from source to keep compatibility with arm (no pre-prebuilt binary for arm) - docker/build.sh will also now use the provided Makefile It will generate an error when trying to get git build has as we do not ship the 88mo .git directory during the build (should not cause any problem as the variable it sets was not set previously) * docker: fix docker arm build - drop gosu version back to 1.7 as gosu binary for armhf is broken - see tianon/gosu#19 * docker: update gosu to 1.9 Signed-off-by: Jean-Philippe Roemer <jp@roemer.im>
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/build.sh21
1 files changed, 15 insertions, 6 deletions
diff --git a/docker/build.sh b/docker/build.sh
index 0bf5c0131d..da36d7e6e0 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -5,19 +5,28 @@ set -e
# Set temp environment vars
export GOPATH=/tmp/go
export PATH=${PATH}:${GOPATH}/bin
+export GO15VENDOREXPERIMENT=1
# Install build deps
-apk --no-cache --no-progress add --virtual build-deps linux-pam-dev go gcc musl-dev
+apk --no-cache --no-progress add --virtual build-deps build-base linux-pam-dev go
-# Init go environment to build Gogs
+# Install glide
+git clone -b 0.10.2 https://github.com/Masterminds/glide ${GOPATH}/src/github.com/Masterminds/glide
+cd ${GOPATH}/src/github.com/Masterminds/glide
+make build
+go install
+
+
+
+# Build Gogs
mkdir -p ${GOPATH}/src/github.com/gogits/
ln -s /app/gogs/ ${GOPATH}/src/github.com/gogits/gogs
cd ${GOPATH}/src/github.com/gogits/gogs
-go get -v -tags "sqlite cert pam"
-go build -tags "sqlite cert pam"
+glide install
+make build TAGS="sqlite cert pam"
-# Cleanup GOPATH
-rm -r $GOPATH
+# Cleanup GOPATH & vendoring dir
+rm -r $GOPATH /app/gogs/vendor
# Remove build deps
apk --no-progress del build-deps