Building a docker image with gitlab-runner

Hi friends,

I would like to build a docker image with gitlab-runner and push it to an AWS ECR repo.
gitlab-runner is installed in a new instance and is configured to use the docker executor and mount the docker socket of the host as in the below link:
https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-socket-binding

.gitlab-ci.yml
https://pastebin.com/raw/bZj4CDuS

Error
https://pastebin.com/raw/pNd6mmF5

The job stops at “exec bash” command. How to correct this?

Done using a custom image, melvincv/docker-dep
Dockerfile
https://pastebin.com/raw/iGkyba0z
usermod does not seem to work, to change the shell
do I need to change the shell for root? Or is the CMD enough?

Did it like this for now:
https://pastebin.com/raw/QLQxGGw5

.gitlab-ci.yml
https://pastebin.com/raw/fE564hiH