# Gitlab-ci docker problem

**URL:** <https://forums.docker.com/t/gitlab-ci-docker-problem/118899>\
**Category:** Docker Hub\
**Tags:** docker, ci, ci\_cd\
**Created:** [December 16, 2021, 8:49pm UTC](https://forums.docker.com/t/gitlab-ci-docker-problem/118899 "2021-12-16T20:49:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![duckdevil22](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/duckdevil22/32/45810_2.png) [@duckdevil22](https://forums.docker.com/u/duckdevil22)\
**Post date:** [December 16, 2021, 8:49pm UTC](https://forums.docker.com/t/gitlab-ci-docker-problem/118899/1 "2021-12-16T20:49:42Z")

</div>

Hi people I’m having a problem with my ci/cd in gitlab at the time of deploying the log below:

---

<div class="post-metadata">

**Author:** ![duckdevil22](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/duckdevil22/32/45810_2.png) [@duckdevil22](https://forums.docker.com/u/duckdevil22)\
**Post date:** [December 16, 2021, 8:53pm UTC](https://forums.docker.com/t/gitlab-ci-docker-problem/118899/2 "2021-12-16T20:53:07Z")

</div>

![Captura de tela de 2021-12-16 17-50-52](https://global.discourse-cdn.com/docker/original/3X/f/3/f388b7b07958c9977fc47d975bce7f9f31e55671.jpeg)

---

<div class="post-metadata">

**Author:** ![duckdevil22](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/duckdevil22/32/45810_2.png) [@duckdevil22](https://forums.docker.com/u/duckdevil22)\
**Post date:** [December 16, 2021, 8:53pm UTC](https://forums.docker.com/t/gitlab-ci-docker-problem/118899/3 "2021-12-16T20:53:49Z")

</div>

and the funny thing is that the build rolls normally

---

<div class="post-metadata">

**Author:** ![duckdevil22](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/duckdevil22/32/45810_2.png) [@duckdevil22](https://forums.docker.com/u/duckdevil22)\
**Post date:** [December 16, 2021, 8:55pm UTC](https://forums.docker.com/t/gitlab-ci-docker-problem/118899/4 "2021-12-16T20:55:44Z")

</div>

segue meu gitlab-ci:

```auto
# PROD
build to prod:
  stage: build
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
    - docker build . -f docker/Dockerfile --build-arg DEPLOY=prod -t $RELEASE_IMAGE
    - docker push $RELEASE_IMAGE
  only:
    - /master/
  environment: prod
  tags:
    - docker

before_script:
  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY

deploy to prod:
  stage: deploy
  image: $RELEASE_IMAGE
  before_script:
  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  script:
    - "DEPLOY_FILE=$(ls /opt/jboss/wildfly/standalone/deployments/ | grep .war | head -1)"
    - echo "Realizando o deploy de $DEPLOY_FILE..."echo "Realizando o deploy de $DEPLOY_FILE..."
    - /opt/jboss/wildfly/bin/jboss-cli.sh --connect --controller=$HOST_WILDFLY --user=$USER_WILDFLY --password=$PW_WILDFLY --timeout=60000 --commands="deploy /opt/jboss/wildfly/standalone/deployments/"$DEPLOY_FILE" --force"
  only:
    - /master/
  environment: prod
  tags:
    - docker

```

I did it with the before\_script tag and without it and it’s the same

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [December 16, 2021, 11:50pm UTC](https://forums.docker.com/t/gitlab-ci-docker-problem/118899/5 "2021-12-16T23:50:23Z")

</div>

I edited your last post. Please, use the `</>` button to highlight the selected code so it won’t be interpreted as MarkDown and we can understand the question better.

Also try to edit your post instead of posting again in such a short period of time. If you post multiple times without getting an answer, it will look like you have got answers

I haven’t used Gitlab CI yet so I can’t how the yml file should look like, but does that registry in the error message exist? Where did you defined that? I tried to access it from a webbrowser but I couldn’t.

Are you sure you login the same registry which you need to download the image?

If the build somehow works, but the pull fails that can be because you have that image locally so even if GitLabCI tries to pull the image before the build, it can continue without it. Since I don’t really know GitlabCI, I can be totally wrong.
