Apologies if I’ve misunderstood but what I’m trying to achieve is a CI build that contains Python 3 and pip 3 and then builds a docker image from my project’s python source and the installed packages.
The .gitlab-ci.yml doesn’t specify an image, so the default ruby:2.5 image is used.
build_image_job:
stage: build
script:
- apt-get update -qy
- apt-get install -y python3.7 python3.7-dev python3-pip
- pip3 install -r requirements/prod.txt
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $CONTAINER_TEST_IMAGE -f docker/Dockerfile .
- docker push $CONTAINER_TEST_IMAGE
However of course the ruby:2.5 image doesn’t contain the Docker CLI.
I tried switching to docker:dind as the image, however that is based on Alpine and use apk not apt, and some of the package I’m using don’t play nice with apk and cause a lot of issues. apt-get however works fine on ruby:2.5
What’s the best way forward to be able to build a docker image from my gitlab job?