From 946fafe836444ccd3a8ae3b95626e991914604e9 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Tue, 27 Jul 2021 20:01:55 +0200 Subject: [PATCH 1/2] Replace binary version of hetzner-driver with build from source --- Dockerfile | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a879d4..dcf4051 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,21 @@ +FROM docker.io/library/golang:1.16.6 as driver-builder + +# renovate: datasource=gitlab-tags depName=git.shivering-isles.com/github-mirror/JonasProgrammer/docker-machine-driver-hetzner +ARG HETZNER_VERSION=3.3.0 + +ENV GO111MODULE=on + +RUN mkdir -p /go/src/app + +WORKDIR /go/src/app + +RUN git clone --depth 3 --branch "$HETZNER_VERSION" https://git.shivering-isles.com/github-mirror/JonasProgrammer/docker-machine-driver-hetzner.git ./ + +RUN go build -o docker-machine-driver-hetzner + FROM docker.io/gitlab/gitlab-runner:v14.1.0 LABEL maintainer="Sheogorath " -# renovate: datasource=github-tags depName=JonasProgrammer/docker-machine-driver-hetzner -ARG HETZNER_VERSION=3.3.0 -ARG HETZNER_HASH=103b9643da895b97fa51c91f843d9be4eced345264ff7e6e91f4e7778e0f56c2 - RUN true \ && apt-get update \ @@ -13,12 +24,4 @@ RUN true \ && apt-get clean && apt-get purge && rm -r /var/lib/apt/lists/* \ && true -RUN true \ - && wget "https://github.com/JonasProgrammer/docker-machine-driver-hetzner/releases/download/${HETZNER_VERSION}/docker-machine-driver-hetzner_${HETZNER_VERSION}_linux_amd64.tar.gz" \ - && echo "${HETZNER_HASH} docker-machine-driver-hetzner_${HETZNER_VERSION}_linux_amd64.tar.gz" > check_file \ - && sha256sum -c check_file \ - && tar -xvf "docker-machine-driver-hetzner_${HETZNER_VERSION}_linux_amd64.tar.gz" \ - && rm "docker-machine-driver-hetzner_${HETZNER_VERSION}_linux_amd64.tar.gz" check_file \ - && chmod +x docker-machine-driver-hetzner \ - && mv docker-machine-driver-hetzner /usr/local/bin/ \ - && true +COPY --from=driver-builder /go/src/app/docker-machine-driver-hetzner /usr/local/bin/ From 4a4203e20079014faab3dca1a1a7908b18336676 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Tue, 27 Jul 2021 20:11:07 +0200 Subject: [PATCH 2/2] Use larger node for building It seems that gitlab-runner images become larger and larger, therefore this patch requests a larger machine for building this image --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f709039..97fa34d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,8 @@ build: script: - podman build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . - podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" + tags: + - ram-4gb test: stage: test