Using Gitlab CI with - Help understanding docker in docker and using docker-compose


I am going through a Python TDD tutorial… actually just starting it… and they use github and travis CI for their continuous. I have been using for years and never got into using Gitlab-CI and felt like this was a perfect time. Of course, can’t even get the configuration right.

The tutorial uses docker-compose and when that command is run on the gitlab CI, i get the error message: Couldn’t connect to Docker daemon. You might need to install Docker

It seems like Gitlab uses docker for all CI and Travis doesn’t? So this makes services:docker work fine in travis but in Gitlab, it is more of a process to have docker commands work inside the docker container?

I’ve been reading up, but still can’t figure out how to get this working… I’m also new to docker. It looks like using a image:docker:latest and then docker:dind service will work but then how am I getting Python 3.6 on there? I can’t install Python for each CI build.

I will paste my Travis config below and if anyone can help me turn it into a working Gitlab-CI YAML config file, that would be awesome. Also, any other info on what is happening here and why such a different experience with the two systems… would be a huge help.

language: python
  - "3.6"

  - docker

before_script: pip install docker-compose

  - docker-compose run --rm app sh -c "python test && flake8"