title: My docker run crash during the test phase of my gitlab CI
body: <p>So i am quite new to the whole CI topic and im trying to run tests after my merge request in my pipeline. Except that when my command try to run the container i have an error.
  So this is my gitlab-ci file</p>
  <pre class="lang-yaml prettyprint-override"><code>image: docker:18
  
  variables:
    REPO_URL: &quot;registry.gitlab.com/xxxxx/xxxxxxx&quot;
    PROD_SRV: &quot;xxx&quot;
    DEV_SRV: &quot;xxx&quot;
  
  services:
    - docker:dind
  
  stages:
    - build jar
    - build docker image
    - tests
    
  
  maven-build:
    only:
      - work
      - test
    image: maven:3-jdk-8
    stage: build jar
    script: &quot;mvn -Dmaven.test.skip=true package -B&quot;
    artifacts:
      paths:
        - target/*.jar
      expire_in: 7 days
  
  docker build:
    stage: build docker image
    only:
      - work
      - test
    before_script:
      - echo &quot;$CI_REGISTRY_PASSWORD&quot; | docker login --username &quot;$CI_REGISTRY_USER&quot;  &quot;$CI_REGISTRY&quot; --password-stdin
      - chmod a+x ./mvnw
    script:
      - docker info
      - docker build -t $REPO_URL:$CI_COMMIT_SHA .
      - docker images
      - docker push $REPO_URL:$CI_COMMIT_SHA
  
    after_script:
      - docker logout registry.gitlab.com 2&gt;/dev/null
      - rm /root/.docker/config.json 2&gt;/dev/null
  
  
  tests job branch test:
    stage: tests
    only:
      - test
    variables:
      GIT_STRATEGY: none
    before_script:
      - echo &quot;$CI_REGISTRY_PASSWORD&quot; | docker login --username &quot;$CI_REGISTRY_USER&quot;  &quot;$CI_REGISTRY&quot; --password-stdin
    script:
      - docker pull $REPO_URL:$CI_COMMIT_SHA
      - docker run -t $REPO_URL:$CI_COMMIT_SHA .
      - docker push $REPO_URL:$CI_COMMIT_SHA
    after_script:
      - docker logout registry.gitlab.com 2&gt;/dev/null
      - rm /root/.docker/config.json 2&gt;/dev/null
  </code></pre>
  <p>and this is my dockerfile</p>
  <pre><code># syntax=docker/dockerfile:1
  
  FROM openjdk:16-alpine3.13 as base
  
  WORKDIR /amsn-counter
  
  COPY .mvn/ .mvn
  COPY mvnw pom.xml ./
  RUN ./mvnw dependency:go-offline
  COPY src ./src
  
  FROM base as test
  RUN [&quot;./mvnw&quot;, &quot;test&quot;]
  
  FROM base as development
  CMD [&quot;./mvnw&quot;, &quot;spring-boot:run&quot;, &quot;-Dspring-boot.run.profiles=mysql&quot;, &quot;-Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000'&quot;]
  
  FROM base as build
  RUN  ./mvnw package
  
  FROM openjdk:11-jre-slim as production
  EXPOSE 8080
  
  ADD /target/linkedin-0.0.1-SNAPSHOT.jar app.jar
  
  ENTRYPOINT [&quot;java&quot;,&quot;-Djava.security.egd=file:/dev/./urandom&quot;,&quot;-jar&quot;,&quot;/app.jar&quot;]
  </code></pre>
  <p>and the error in the pipeline as well:
  <img src="https://i.stack.imgur.com/48Xpm.png" alt="and the error in the pipeline as well" /></p>
  <p>If you need any precision i will gladly answer, and like i said im new so don't hesitate to point if something is weird in the files or in my description in general</p>
  <p>Edit: My branch are named {work}(local branch) and {test}</p>