From ec18a9a51e292487559140b9dd259cbf77b9bb8f Mon Sep 17 00:00:00 2001 From: J0WI Date: Thu, 18 Jan 2018 15:59:51 +0100 Subject: [PATCH] Use upstream go image --- Dockerfile | 5 ++--- docker/build-go.sh | 32 -------------------------------- docker/finalize.sh | 1 - 3 files changed, 2 insertions(+), 36 deletions(-) delete mode 100755 docker/build-go.sh diff --git a/Dockerfile b/Dockerfile index 035b59a43..8b882e4d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.5 +FROM golang:1.8-alpine # Install system utils & Gogs runtime dependencies ADD https://github.com/tianon/gosu/releases/download/1.9/gosu-amd64 /usr/sbin/gosu @@ -27,8 +27,7 @@ COPY public /app/gogs/public WORKDIR /app/gogs/build COPY . . -RUN ./docker/build-go.sh \ - && ./docker/build.sh \ +RUN ./docker/build.sh \ && ./docker/finalize.sh # Configure Docker Container diff --git a/docker/build-go.sh b/docker/build-go.sh deleted file mode 100755 index 22e3724d8..000000000 --- a/docker/build-go.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Build GO version as specified in Dockerfile - -set -x -set -e - -# Components versions -export GOLANG_VERSION="1.8" -export GOLANG_SRC_URL="https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz" -export GOLANG_SRC_SHA256="406865f587b44be7092f206d73fc1de252600b79b3cacc587b74b5ef5c623596" - - -# Install build tools -apk add --no-cache --no-progress --virtual build-deps-go gcc musl-dev openssl go - -export GOROOT_BOOTSTRAP="$(go env GOROOT)" - -# Download Go -wget -q "$GOLANG_SRC_URL" -O golang.tar.gz -echo "$GOLANG_SRC_SHA256 golang.tar.gz" | sha256sum -c - -tar -C /usr/local -xzf golang.tar.gz -rm golang.tar.gz - -# Build -cd /usr/local/go/src -# see https://golang.org/issue/14851 -patch -p2 -i /app/gogs/build/docker/no-pic.patch -./make.bash - -# Clean -rm /app/gogs/build/docker/*.patch -apk del build-deps-go diff --git a/docker/finalize.sh b/docker/finalize.sh index 9adc506a0..3fb0f805d 100755 --- a/docker/finalize.sh +++ b/docker/finalize.sh @@ -10,7 +10,6 @@ mv /app/gogs/build/gogs /app/gogs/ # Final cleaning rm -rf /app/gogs/build rm /app/gogs/docker/build.sh -rm /app/gogs/docker/build-go.sh rm /app/gogs/docker/finalize.sh rm /app/gogs/docker/nsswitch.conf rm /app/gogs/docker/README.md