diff --git a/.dockerignore b/.dockerignore index 092eef43c47..b33dbf58a80 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,5 @@ .git .git/** -conf -conf/** packager packager/** scripts @@ -9,13 +7,13 @@ scripts/** .github/ .github/** config.codekit -LICENSE -Makefile .dockerignore *.yml *.md .bra.toml .editorconfig .gitignore -.gopmfile Dockerfile* +vendor +vendor/** +gogs diff --git a/Dockerfile b/Dockerfile index 8853eab51a8..e45c0c065cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.3 MAINTAINER jp@roemer.im # Install system utils & Gogs runtime dependencies -ADD https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64 /usr/sbin/gosu +ADD https://github.com/tianon/gosu/releases/download/1.9/gosu-amd64 /usr/sbin/gosu RUN chmod +x /usr/sbin/gosu \ && apk --no-cache --no-progress add ca-certificates bash git linux-pam s6 curl openssh socat diff --git a/Dockerfile.rpi b/Dockerfile.rpi index 6e2c4264b61..948f8f178c5 100644 --- a/Dockerfile.rpi +++ b/Dockerfile.rpi @@ -2,7 +2,7 @@ FROM hypriot/rpi-alpine-scratch:v3.2 MAINTAINER jp@roemer.im, raxetul@gmail.com # Install system utils & Gogs runtime dependencies -ADD https://github.com/tianon/gosu/releases/download/1.7/gosu-armhf /usr/sbin/gosu +ADD https://github.com/tianon/gosu/releases/download/1.9/gosu-armhf /usr/sbin/gosu RUN chmod +x /usr/sbin/gosu \ && echo "http://dl-4.alpinelinux.org/alpine/v3.3/main/" | tee /etc/apk/repositories \ && echo "http://dl-4.alpinelinux.org/alpine/v3.3/community/" | tee -a /etc/apk/repositories \ diff --git a/docker/build.sh b/docker/build.sh index 0bf5c0131d1..da36d7e6e0f 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