1

I'am new to gitlab-ci. Probably i have problem with git-lab runner or on my gitlab-ci.yml file. Script on my image use whois command.

gitlab-ci.yml

image: docker:18 services: - docker:dind stages: - build - test before_script: - docker info build: stage: build script: - echo "build" - docker build -t image. test: stage: test script: - echo "test" - docker run -i image 185.33.37.131 

test returns

$ docker run -i image 185.33.37.131 Unable to find image 'image:latest' locally docker: Error response from daemon: pull access denied for image, repository does not exist or may require 'docker login'. See 'docker run --help'. ERROR: Job failed: exit code 125 

docker info returns suspect value

$ docker info Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 . . . Successfully built 64f54ee594e7 Successfully tagged image:latest 
1
  • 1
    You are building an image tagged image and, at least according to the output, running an image tagged ip_info. Is this the entire source code? Commented Jun 5, 2019 at 18:20

1 Answer 1

1

You are building the image in one GitLab job and then trying to run it in another one. Each job is isolated from the others, so the image would no longer exist in the test job. You should push the image to a docker registry after building it and then pull it from the registry when you want to run it.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.