From eed38af34fa56b6766b0393fd23b87d99f3eb96b Mon Sep 17 00:00:00 2001
From: Kay E <kay@jointech.org>
Date: Thu, 12 Jan 2023 16:19:48 +0100
Subject: [PATCH] FIX(gitlab-ci)

---
 .gitlab-ci.yml | 19 +++++++++++--------
 Dockerfile     | 15 +++++++++------
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1e0e654..c03d751 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,7 @@
+image: docker:stable
 variables:
   DOCKER_HOST: tcp://docker:2375/
+  DOCKER_TLS_CERTDIR: ""
 
 stages:
   - test
@@ -33,6 +35,7 @@ run_test_cases:
       junit: report.xml
 
 check_coverage:
+  image: python:3.9
   stage: test
   needs: ["run_test_cases"]
   before_script:
@@ -48,6 +51,7 @@ check_coverage:
         path: coverage.xml
 
 check_style:
+  image: python:3.9
   stage: test
   needs: ["run_test_cases"]
   before_script:
@@ -59,29 +63,28 @@ check_style:
 
 docker-push:
   # Use the docker image with buildx support for multi arch.
-  image: jonoh/docker-buildx-qemu
+  image: jdrouet/docker-with-buildx:20.10.21-0.9.1
   stage: release
   variables:
     # the name of the image without version
     AURA_IMAGE_NAME: "autoradio/engine-recorder"
   services:
-    - docker:dind
+    - docker:20.10.21-dind
+
   before_script:
     # default repo is docker.io (aka docker hub)
     - docker login -u "$DOCKER_ID" -p "$DOCKER_HUB_AUTH"
-    - docker buildx create --driver docker-container --use
-    - docker buildx inspect --bootstrap
+    - docker buildx create --use
   script:
-    # Important: Ensures execution of other binary formats is enabled in the kernel
-    - update-binfmts --enable
     # every commit on main branch should build image as unstable
     # else it is from a tag (enforced by gitlab-ci rules)
     # hint: tags are references independent of branches
     - |
       if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]
-        then docker buildx build --platform linux/arm/v6,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME:unstable --push.
-        else docker buildx build --platform linux/arm/v6,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG --push.
+        then docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME:unstable .
+        else docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG .
       fi
+    - docker push "$AURA_IMAGE_NAME" --all-tags
   rules:
     # - *release-rules
     - if: $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+$/ || $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+[-]\S+$/
diff --git a/Dockerfile b/Dockerfile
index cab57f8..6fc5f4e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,20 +3,22 @@ FROM python:3.9-slim
 LABEL maintainer="Loxbie <ole@freirad.at>"
 
 # System Dependencies
-
 RUN apt-get update && apt-get -y install \
       apt-utils \
       alsa-utils \
       build-essential \
       ffmpeg \
-      rsync
+      rsync \
+      libffi-dev \
+      libssl-dev \
+      cargo \
+      pkg-config
 
 RUN pip install poetry
 
 
 # Setup Engine-Recorder
-
-RUN mkdir -p /srv
+WORKDIR /srv
 RUN mkdir -p /srv/src
 RUN mkdir -p /srv/config
 RUN mkdir -p /srv/log
@@ -24,16 +26,17 @@ RUN mkdir -p /var/audio/recordings/block
 
 COPY poetry.lock /srv
 COPY pyproject.toml /srv
+RUN poetry install --without dev --no-interaction
 COPY src /srv/src
 COPY config/for-docker.yaml /srv/config/engine-recorder.yaml
 COPY README.md /srv
 COPY Makefile /srv
 
-WORKDIR /srv
+
 
 # RUN curl -sSL https://install.python-poetry.org | python3 -
 # RUN export PATH="/root/.local/bin:$PATH"
-RUN poetry install --without dev --no-interaction
+
 
 # for Alsa when running docker run engine-recorder https://github.com/mviereck/x11docker/wiki/Container-sound:-ALSA-or-Pulseaudio
 
-- 
GitLab