diff --git a/Dockerfile.custom b/Dockerfile.custom index e4177c7..a7ab2de 100644 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -33,9 +33,9 @@ ARG YARN_INSTALL_VERSION RUN if [ -n "$NODE_INSTALL_VERSION" ] ; then /scripts/install-node $NODE_INSTALL_VERSION $YARN_INSTALL_VERSION && node --version && yarn --version; fi # Golang -ARG GOLANG_VERSION +ARG INSTALL_GOLANG_VERSION ARG GOLANG_DOWNLOAD_SHA256 -RUN if [ -n "$GOLANG_VERSION" ] ; then /scripts/install-golang && go version; fi +RUN if [ -n "$INSTALL_GOLANG_VERSION" ] ; then /scripts/install-golang "${INSTALL_GOLANG_VERSION}" "${GOLANG_DOWNLOAD_SHA256}" && go version; fi # Postgres # Codedebt: currently this will only install the default version of postgres, diff --git a/Dockerfile.www-gitlab-com b/Dockerfile.www-gitlab-com index 8307459..bc391ac 100644 --- a/Dockerfile.www-gitlab-com +++ b/Dockerfile.www-gitlab-com @@ -1,7 +1,5 @@ FROM ruby:2.3-slim -ENV PACKAGES="git-core pandoc texlive-latex-recommended texlive-xetex texlive-fonts-recommended lmodern ed file curl" - ADD / / RUN /scripts/install-www-gitlab-com diff --git a/scripts/custom-docker-build b/scripts/custom-docker-build index af59b81..fadaa3e 100755 --- a/scripts/custom-docker-build +++ b/scripts/custom-docker-build @@ -7,17 +7,17 @@ function print_golang_args() { case "$1" in 1.8) - GOLANG_VERSION=1.8 + INSTALL_GOLANG_VERSION=1.8 GOLANG_DOWNLOAD_SHA256=253ab94104ee3923e228a2cb2116e5e462ad3ebaeea06ff04463479d7f12d27ca ;; 1.9) - GOLANG_VERSION=1.9.2 + INSTALL_GOLANG_VERSION=1.9.2 GOLANG_DOWNLOAD_SHA256=de874549d9a8d8d8062be05808509c09a88a248e77ec14eb77453530829ac02b ;; *) echo "Unknown golang version $1"; exit 1; esac - printf -- "--build-arg GOLANG_VERSION=%s " "$GOLANG_VERSION" + printf -- "--build-arg INSTALL_GOLANG_VERSION=%s " "$INSTALL_GOLANG_VERSION" printf -- "--build-arg GOLANG_DOWNLOAD_SHA256=%s " "$GOLANG_DOWNLOAD_SHA256" } diff --git a/scripts/install-chrome b/scripts/install-chrome index 3ad988c..044a6c1 100755 --- a/scripts/install-chrome +++ b/scripts/install-chrome @@ -1,8 +1,10 @@ #!/bin/bash -set -xeo pipefail +set -xeuo pipefail +IFS=$'\n\t' CHROME_VERSION=${1:-60.0.3112.90-1} +export DEBIAN_FRONTEND=noninteractive curl -sS -L https://dl.google.com/linux/linux_signing_key.pub | apt-key add - echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list diff --git a/scripts/install-essentials b/scripts/install-essentials index ffbf14e..2df4a5a 100755 --- a/scripts/install-essentials +++ b/scripts/install-essentials @@ -1,6 +1,9 @@ #!/bin/bash -set -xeo pipefail +set -xeuo pipefail +IFS=$'\n\t' + +export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install -y \ diff --git a/scripts/install-git b/scripts/install-git index 7231150..109fc2d 100755 --- a/scripts/install-git +++ b/scripts/install-git @@ -1,4 +1,7 @@ -#!/bin/sh +#!/bin/bash + +set -xeuo pipefail +IFS=$'\n\t' mkdir build \ && curl -fsSL "$GIT_DOWNLOAD_URL" -o git.tar.gz \ diff --git a/scripts/install-golang b/scripts/install-golang index 74b86f8..25532b8 100755 --- a/scripts/install-golang +++ b/scripts/install-golang @@ -1,10 +1,13 @@ #!/bin/bash -GOLANG_VERSION=${1:-1.8} -GOLANG_DOWNLOAD_URL="https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz" -GOLANG_DOWNLOAD_SHA256=${2:-53ab94104ee3923e228a2cb2116e5e462ad3ebaeea06ff04463479d7f12d27ca} +set -xeou pipefail -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 +INSTALL_GOLANG_VERSION=${1} +GOLANG_DOWNLOAD_SHA256=${2} + +GOLANG_DOWNLOAD_URL="https://golang.org/dl/go${INSTALL_GOLANG_VERSION}.linux-amd64.tar.gz" + +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 diff --git a/scripts/install-node b/scripts/install-node index da509a3..d317050 100755 --- a/scripts/install-node +++ b/scripts/install-node @@ -1,6 +1,6 @@ #!/bin/bash - -set -xeo pipefail +set -xeuo pipefail +IFS=$'\n\t' NODE_INSTALL_VERSION=${1:-7.x} YARN_INSTALL_VERSION=${2:-0.27.5-1} diff --git a/scripts/install-postgresql b/scripts/install-postgresql index faef1c0..826edad 100755 --- a/scripts/install-postgresql +++ b/scripts/install-postgresql @@ -1,10 +1,12 @@ #!/bin/bash +set -xeuo pipefail +IFS=$'\n\t' -set -xeo pipefail +export DEBIAN_FRONTEND=noninteractive curl -sS -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" | tee /etc/apt/sources.list.d/postgresql.list apt-get update -env DEBIAN_FRONTEND="noninteractive" apt-get install -y postgresql-client +apt-get install -y postgresql-client apt-get autoremove -yq diff --git a/scripts/install-ruby b/scripts/install-ruby index 3ebeaf3..7aa1212 100755 --- a/scripts/install-ruby +++ b/scripts/install-ruby @@ -1,6 +1,6 @@ #!/bin/bash - -set -xeo pipefail +set -xeuo pipefail +IFS=$'\n\t' cd /tmp wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz diff --git a/scripts/install-www-gitlab-com b/scripts/install-www-gitlab-com index 3593997..cea7788 100755 --- a/scripts/install-www-gitlab-com +++ b/scripts/install-www-gitlab-com @@ -1,11 +1,15 @@ #!/bin/bash -set -xeo pipefail +set -xeuo pipefail +IFS=$'\n\t' + +export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install -yq --no-install-recommends \ make gcc g++ locales \ - $PACKAGES + git-core pandoc texlive-latex-recommended texlive-xetex \ + texlive-fonts-recommended lmodern ed file curl apt-get autoremove -yq