From bbdb4d77cf85763a72cce379e1b08ab9ae4327ce Mon Sep 17 00:00:00 2001 From: Serhii Doroshenkov Date: Fri, 21 Jul 2023 17:27:58 +0200 Subject: [PATCH 1/2] support arm architecture To be able build not only amd64 images we need to support golang downloading for proper architecture. Example: docker buildx build --platform=linux/arm64 -t sameersbn/gitlab . --- assets/build/install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/build/install.sh b/assets/build/install.sh index b266654d4..2a0580a63 100755 --- a/assets/build/install.sh +++ b/assets/build/install.sh @@ -98,8 +98,9 @@ gem install bundler:"${BUNDLER_VERSION}" # download golang echo "Downloading Go ${GOLANG_VERSION}..." -wget -cnv https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz -P ${GITLAB_BUILD_DIR}/ -tar -xf ${GITLAB_BUILD_DIR}/go${GOLANG_VERSION}.linux-amd64.tar.gz -C /tmp/ +dpkgArch="$(dpkg --print-architecture)" +wget -cnv https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${dpkgArch}.tar.gz -P ${GITLAB_BUILD_DIR}/ +tar -xf ${GITLAB_BUILD_DIR}/go${GOLANG_VERSION}.linux-${dpkgArch}.tar.gz -C /tmp/ # install gitlab-shell echo "Downloading gitlab-shell v.${GITLAB_SHELL_VERSION}..." @@ -164,7 +165,7 @@ rm -rf ${GITLAB_GITALY_BUILD_DIR} # remove go go clean --modcache -rm -rf ${GITLAB_BUILD_DIR}/go${GOLANG_VERSION}.linux-amd64.tar.gz ${GOROOT} +rm -rf ${GITLAB_BUILD_DIR}/go${GOLANG_VERSION}.linux-${dpkgArch}.tar.gz ${GOROOT} # remove HSTS config from the default headers, we configure it in nginx exec_as_git sed -i "/headers\['Strict-Transport-Security'\]/d" ${GITLAB_INSTALL_DIR}/app/controllers/application_controller.rb From fc4d024357233df7571ea4a38ec99ca66cc6cc8b Mon Sep 17 00:00:00 2001 From: Serhii Doroshenkov Date: Thu, 24 Aug 2023 17:46:11 +0200 Subject: [PATCH 2/2] Init environment variables each time. --- assets/build/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/build/install.sh b/assets/build/install.sh index 2a0580a63..7472337e5 100755 --- a/assets/build/install.sh +++ b/assets/build/install.sh @@ -98,7 +98,7 @@ gem install bundler:"${BUNDLER_VERSION}" # download golang echo "Downloading Go ${GOLANG_VERSION}..." -dpkgArch="$(dpkg --print-architecture)" +dpkgArch="$(dpkg-architecture -qDEB_HOST_ARCH)" wget -cnv https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${dpkgArch}.tar.gz -P ${GITLAB_BUILD_DIR}/ tar -xf ${GITLAB_BUILD_DIR}/go${GOLANG_VERSION}.linux-${dpkgArch}.tar.gz -C /tmp/