X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/fff97e62c85b4bcfc0a1973fb5a6aff4ce1b835f..6fffa62bdb67c691e6958cf6f73c4a5fd32e0746:/build/package-build-dockerfiles/centos7/Dockerfile diff --git a/build/package-build-dockerfiles/centos7/Dockerfile b/build/package-build-dockerfiles/centos7/Dockerfile index 01662d6ac5..5bae5f434c 100644 --- a/build/package-build-dockerfiles/centos7/Dockerfile +++ b/build/package-build-dockerfiles/centos7/Dockerfile @@ -3,10 +3,13 @@ # SPDX-License-Identifier: AGPL-3.0 ARG HOSTTYPE +ARG BRANCH +ARG GOVERSION FROM centos:7 as build_x86_64 # Install go -ONBUILD ADD generated/go1.17.1.linux-amd64.tar.gz /usr/local/ +ONBUILD ARG GOVERSION +ONBUILD ADD generated/go${GOVERSION}.linux-amd64.tar.gz /usr/local/ ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/ # Install nodejs and npm ONBUILD ADD generated/node-v10.23.1-linux-x64.tar.xz /usr/local/ @@ -14,7 +17,8 @@ ONBUILD RUN ln -s /usr/local/node-v10.23.1-linux-x64/bin/* /usr/local/bin/ FROM centos:7 as build_aarch64 # Install go -ONBUILD ADD generated/go1.17.1.linux-arm64.tar.gz /usr/local/ +ONBUILD ARG GOVERSION +ONBUILD ADD generated/go${GOVERSION}.linux-arm64.tar.gz /usr/local/ ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/ # Install nodejs and npm ONBUILD ADD generated/node-v10.23.1-linux-arm64.tar.xz /usr/local/ @@ -64,7 +68,12 @@ RUN /usr/local/rvm/bin/rvm-exec default bundle config --global jobs $(let a=$(gr # Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/ ENV MAKE "make --jobs $(grep -c processor /proc/cpuinfo)" +# Preseed the go module cache and the ruby gems, using the currently checked +# out branch of the source tree. This avoids potential compatibility issues +# between the version of Ruby and certain gems. RUN git clone --depth 1 git://git.arvados.org/arvados.git /tmp/arvados && \ + cd /tmp/arvados && \ + if [[ -n "${BRANCH}" ]]; then git checkout ${BRANCH}; fi && \ cd /tmp/arvados/services/api && \ /usr/local/rvm/bin/rvm-exec default bundle install && \ cd /tmp/arvados/apps/workbench && \