Docker and Gitlab-Runner

I need to set up a system that converts each new version of the project pushed to the Gitlab repository into an exe file and saves it in the same project. I will do this with Docker. I will connect gitlab-runner and docker, run the docker container with gitlab-runner, convert it to an exe file in this container and push the exe file to gitlab.

My Dockerfile;

Dockerfile

FROM arm64v8/ubuntu:20.04

Kaynak dosyalarını Docker içine kopyala

COPY . /app

RUN apt-get update &&
apt-get install -y software-properties-common &&
add-apt-repository ppa:deadsnakes/ppa &&
apt-get update &&
apt-get install -y python3.8 &&
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 10 &&
update-alternatives --set python3 /usr/bin/python3.8 &&
apt-get install -y python3-pyqt5

RUN apt-get install --reinstall -y python3.8-distutils+

RUN apt-get install -y python3-pip

RUN apt-get install python3.8-dev &&
pip3 install --upgrade setuptools &&
pip3 install --upgrade wheel &&
pip3 install psutil &&
pip3 install pyserial &&
pip3 install crc16&&
apt-get install -y python3-pyqt5.qtserialport &&
pip3 install matplotlib &&
pip3 install pyqtgraph &&
pip3 install pyqrcode &&
pip3 install pyautogui &&
apt-get install -y python3.8-tk &&
pip3 install PyInstaller &&
pip3 install tinyaes &&
apt-get install libc6 \

WORKDIR /app

.spec dosyasını kopyala

COPY ci-cd-test-area.spec /app

PyInstaller ile projeyi derle

RUN python3 -m PyInstaller /app/ci-cd-test-area.spec

and my gitlab-ci.yml;
default:
image: docker:20.10.16
services:
- docker:20.10.16-dind

before_script:

- docker info

variables:
DOCKER_TLS_CERTDIR: “/certs”

build:
stage: build
script:
- docker build -t my-docker-image --platform=linux/arm64 .
- container_id=$(docker run -d -t --name test my-docker-image)
- docker cp $container_id:/dist .
- cd dist
- ls
artifacts:
paths:
- /dist

so, I take some errors like this;

Reason for your error is not running DinD, hints in the lines 46 and above (which you didn’t include)