From 616e7d961b0ff44006460c8781b8f180cfbc9378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Wed, 29 Mar 2017 17:50:14 -0300 Subject: [PATCH] Add image with golang for use with gitlab-ce builds with gitaly --- .gitlab-ci.yml | 2 ++ Dockerfile.golang-1.5-git-2.8.4 | 2 +- Dockerfile.golang-1.6-git-2.8.4 | 2 +- Dockerfile.golang-1.7-git-2.8.4 | 2 +- Dockerfile.golang-1.8-git-2.8.4 | 2 +- ...-golang-1.8-git-2.7-phantomjs-2.1-node-7.1 | 14 ++++++++++++ scripts/install-git | 14 ++++++++++++ scripts/install-golang | 22 ++++++++----------- 8 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 Dockerfile.ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1 create mode 100755 scripts/install-git diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a90b763..ba51590 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,7 @@ ruby-2.1-git-2.7-phantomjs-2.1 test: *test_build ruby-2.3-git-2.7-phantomjs-2.1 test: *test_build ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1 test: *test_build ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6 test: *test_build +ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1 test: *test_build ruby-2.3-static-analyses test: *test_build www-gitlab-com test: *test_build doc-gitlab-com test: *test_build @@ -45,6 +46,7 @@ ruby-2.1-git-2.7-phantomjs-2.1: *build_and_deploy ruby-2.3-git-2.7-phantomjs-2.1: *build_and_deploy ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1: *build_and_deploy ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6: *build_and_deploy +ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1: *build_and_deploy ruby-2.3-static-analyses: *build_and_deploy www-gitlab-com: *build_and_deploy doc-gitlab-com: *build_and_deploy diff --git a/Dockerfile.golang-1.5-git-2.8.4 b/Dockerfile.golang-1.5-git-2.8.4 index 94d0078..741ea0c 100644 --- a/Dockerfile.golang-1.5-git-2.8.4 +++ b/Dockerfile.golang-1.5-git-2.8.4 @@ -11,6 +11,6 @@ RUN apt-get update && apt-get install -y \ ADD . $PWD -RUN scripts/install-golang +RUN scripts/install-git ENV PATH /usr/local/bin:$PATH diff --git a/Dockerfile.golang-1.6-git-2.8.4 b/Dockerfile.golang-1.6-git-2.8.4 index 9e1c136..ec670fa 100644 --- a/Dockerfile.golang-1.6-git-2.8.4 +++ b/Dockerfile.golang-1.6-git-2.8.4 @@ -11,6 +11,6 @@ RUN apt-get update && apt-get install -y \ ADD . $PWD -RUN scripts/install-golang +RUN scripts/install-git ENV PATH /usr/local/bin:$PATH diff --git a/Dockerfile.golang-1.7-git-2.8.4 b/Dockerfile.golang-1.7-git-2.8.4 index efa63af..0db4c76 100644 --- a/Dockerfile.golang-1.7-git-2.8.4 +++ b/Dockerfile.golang-1.7-git-2.8.4 @@ -11,6 +11,6 @@ RUN apt-get update && apt-get install -y \ ADD . $PWD -RUN scripts/install-golang +RUN scripts/install-git ENV PATH /usr/local/bin:$PATH diff --git a/Dockerfile.golang-1.8-git-2.8.4 b/Dockerfile.golang-1.8-git-2.8.4 index e008e8e..f4f2638 100644 --- a/Dockerfile.golang-1.8-git-2.8.4 +++ b/Dockerfile.golang-1.8-git-2.8.4 @@ -11,6 +11,6 @@ RUN apt-get update && apt-get install -y \ ADD . $PWD -RUN scripts/install-golang +RUN scripts/install-git ENV PATH /usr/local/bin:$PATH diff --git a/Dockerfile.ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1 b/Dockerfile.ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1 new file mode 100644 index 0000000..e0fe03f --- /dev/null +++ b/Dockerfile.ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1 @@ -0,0 +1,14 @@ +FROM ruby:2.3.3 + +ADD / / +RUN /scripts/install-essentials +RUN /scripts/install-phantomjs 2.1.1 +RUN /scripts/install-node +RUN /scripts/install-golang + +ENV PATH /usr/local/go/bin:$PATH + +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 diff --git a/scripts/install-git b/scripts/install-git new file mode 100755 index 0000000..7231150 --- /dev/null +++ b/scripts/install-git @@ -0,0 +1,14 @@ +#!/bin/sh + +mkdir build \ + && curl -fsSL "$GIT_DOWNLOAD_URL" -o git.tar.gz \ + && echo "$GIT_DOWNLOAD_SHA256 git.tar.gz" | sha256sum -c - \ + && tar -C build -xzf git.tar.gz \ + && cd build/git-$GIT_VERSION \ + && chmod +x configure \ + && ./configure \ + && make all \ + && make install PREFIX=/usr/local \ + && cd ../.. \ + && rm -rf build \ + && rm git.tar.gz diff --git a/scripts/install-golang b/scripts/install-golang index 7231150..74b86f8 100755 --- a/scripts/install-golang +++ b/scripts/install-golang @@ -1,14 +1,10 @@ -#!/bin/sh +#!/bin/bash -mkdir build \ - && curl -fsSL "$GIT_DOWNLOAD_URL" -o git.tar.gz \ - && echo "$GIT_DOWNLOAD_SHA256 git.tar.gz" | sha256sum -c - \ - && tar -C build -xzf git.tar.gz \ - && cd build/git-$GIT_VERSION \ - && chmod +x configure \ - && ./configure \ - && make all \ - && make install PREFIX=/usr/local \ - && cd ../.. \ - && rm -rf build \ - && rm git.tar.gz +GOLANG_VERSION=${1:-1.8} +GOLANG_DOWNLOAD_URL="https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz" +GOLANG_DOWNLOAD_SHA256=${2:-53ab94104ee3923e228a2cb2116e5e462ad3ebaeea06ff04463479d7f12d27ca} + +curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ + && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ + && tar -C /usr/local -xzf golang.tar.gz \ + && rm golang.tar.gz