How to include a docker image from a list of allowed images in CI/CD pipeline

I’m creating a CI/CD job to automate the building of new container images in gitlab. I’m using the default docker template for this reason, but I ran into this issue when executing the job.

In .gitlab-ci.yml I have the usual line:

  image: docker:latest
     - docker:dind

But based on the output I see that:

Please check runner's configuration:
ERROR: Failed to remove network for build
ERROR: Preparation failed: disallowed image

This follows with a list of available images which I can use, and one has docker in its path, like this:

ERROR: The "docker:latest" image is not present on list of allowed images:
- azul/*:*
- buildpack-deps:*

I don’t understand, how do I use a docker image from the**/* path above in .gitlab-ci.yml?