Merge branch 'feature/build-from-source' into 'main'
Replace binary version of hetzner-driver with build from source See merge request shivering-isles/gitlab-hetzner-runner!31
This commit is contained in:
commit
dde7b9e987
2 changed files with 18 additions and 13 deletions
|
@ -19,6 +19,8 @@ build:
|
||||||
script:
|
script:
|
||||||
- podman build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
|
- podman build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
|
||||||
- podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
- podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
||||||
|
tags:
|
||||||
|
- ram-4gb
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
|
|
29
Dockerfile
29
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
|
FROM docker.io/gitlab/gitlab-runner:v14.1.0
|
||||||
|
|
||||||
LABEL maintainer="Sheogorath <sheogorath@shivering-isles.com>"
|
LABEL maintainer="Sheogorath <sheogorath@shivering-isles.com>"
|
||||||
# renovate: datasource=github-tags depName=JonasProgrammer/docker-machine-driver-hetzner
|
|
||||||
ARG HETZNER_VERSION=3.3.0
|
|
||||||
ARG HETZNER_HASH=103b9643da895b97fa51c91f843d9be4eced345264ff7e6e91f4e7778e0f56c2
|
|
||||||
|
|
||||||
|
|
||||||
RUN true \
|
RUN true \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
|
@ -13,12 +24,4 @@ RUN true \
|
||||||
&& apt-get clean && apt-get purge && rm -r /var/lib/apt/lists/* \
|
&& apt-get clean && apt-get purge && rm -r /var/lib/apt/lists/* \
|
||||||
&& true
|
&& true
|
||||||
|
|
||||||
RUN true \
|
COPY --from=driver-builder /go/src/app/docker-machine-driver-hetzner /usr/local/bin/
|
||||||
&& 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
|
|
||||||
|
|
Reference in a new issue