Skip to content

locate docker image after build #902

Closed Answered by firecow
alex116 asked this question in Q&A
Discussion options

You must be logged in to vote

When using docker:dind as a service, the built image only lives for a short while during build_test_image execution.
After that the service it shutdown, all images built inside the job during that time just disappears into the blue.

You need a docker image registry, that you should push the built image to, in order for you to use it in subsequent jobs.

I sometimes use shell-executor jobs to built docker images, then they will appear under your docker image ls

build_test_image:
  script:
    - docker build -f Dockerfile -t myimage:latest .
    
ola:
  script:
    - docker run myimage:latest

One could also mount ones /var/run/docker.sock into the job locally.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@alex116
Comment options

@firecow
Comment options

Answer selected by firecow
@alex116
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants