Skip to content

Display pull command for container registry tag

What does this MR do and why?

When browsing the container images in a container registry of a group or a project, it may not be obvious to the user how to use the container image tag.

For a user, it may be easier to consume a container image tag if an example is displayed. Some other popular SCM hosting service displays examples of a "docker pull" command and "Dockerfile FROM" line.

This MR is a proposal to add two new lines to the container registry image tag detail information:

  • Install from the command line: docker pull example.com/group/project:tag
  • Use as base image in Dockerfile: FROM example.com/group/project:tag

Screenshots or screen recordings

Pre-MR:

pre-mr

Post-MR:

post-mr

How to set up and validate locally

  1. Start GitLab and open GitLab (locally with the GitLab Development Kit (GDK), or online with GitPod)
  2. Enable the Container Registry (this may require to reconfigure the GDK, or a restart of GitLab Puma/Ruby on Rails services). (On my MacBook, I started the container registry listening at TCP port 5001 instead of the default TCP port 5000 to avoid a port binding conflict with macOS AirPlay/AirTunes service.)
  3. Upload a container image to the container registry of a GitLab projects (like flightjs/flight from the GDK seed projects). (You may use any container image you like.)
    $ docker image pull ubuntu:latest
    $ docker login localhost:5001
    $ docker image tag ubuntu:latest localhost:5001/flightjs/flight:latest
    $ docker image push localhost:5001/flightjs/flight:latest
  4. Open the container registry (like http://127.0.0.1:3000/flightjs/Flight/container_registry/1)
  5. Expand the details of a container image tag present in the container registry

Before this MR, the container image tag details display the publishing timestamp, manifest and configuration digest.

With this MR, the details list displays in addition a docker pull command and Dockerfile FROM line.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Daniel Schömer

Merge request reports