JetBrains Space Help

Publish Container Images

Suppose you have a Docker image and want to publish it to the newly created container registry using:

Note that publishing images with the same image version is not allowed. The server will return the 409 HTTP response.

Publish images using Docker command-line tool

  1. Log in to the container registry:

    docker login mycompany.registry.jetbrains.space
    here

    • mycompany.registry.jetbrains.space is the registry URL


      (mycompany is the name of your company in Space). If you are not sure about the URL, you can copy the URL of a particular container registry on the Packages page.

  2. When asked for credentials, specify either your Space username and password (we recommend that you use a permanent token instead) or a client ID and a client secret of a service account.

  3. If your image is not yet created, build it with docker build.

  4. Tag the image for the container registry:

    docker tag myimage mycompany.registry.jetbrains.space/p/projectkey/mydocker/myimage
    here

    • myimage is the name of your image,

    • mycompany.registry.jetbrains.space/p/projectkey/mydocker/ is the namespace of your container registry. You can find it in Packages, on the page of the particular registry.

  5. Publish the image to the registry:

    docker push mycompany.registry.jetbrains.space/p/projectkey/mydocker/myimage

Publish images from JetBrains TeamCity

Prerequisites: You have a working build configuration in TeamCity that creates a Docker image. Your task is to publish this image to a Space Packages registry.

  1. In Space, create an application account that you will use for connecting to Space from TeamCity.

  2. Connect the TeamCity instance to the Packages registry where you want publish images. In TeamCity:

    • in project properties, choose Connection | Add Connection,

    • in the connection settings, specify the URL of the Docker registry (it should look like mycompany.registry.jetbrains.space) and the application account credentials (a client ID and a permanent token).

    TeamCity. Add Docker repository
  3. Add Docker support to your TeamCity build configuration: In the build configuration settings, choose Build Features | Add build feature.

  4. In the Add Build Feature window:

    • choose Docker Support,

    • in Log in to the Docker registry before the build, choose the connection you have created in step 1.

    TeamCity. Add Docker support

    After you add the Docker support, TeamCity will log in to the Space container registry before the build. In addition, the build will get a separate tab with info about created Docker images.

  5. Add corresponding Docker build steps to your build configuration. For example, a step that runs:

    docker push mycompany.registry.jetbrains.space/p/projectkey/mydocker/myimage:%build.number%

Publish images from Space Automation

Space Automation provides special DSL to ease building and publishing Docker images. Learn more

Last modified: 28 April 2022