Publish Container Images
Let's assume 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
Log in to the container registry:docker login mycompany.registry.jetbrains.spacehere
mycompany.registry.jetbrains.spaceis the registry URL
mycompanyis 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.
If your image is not yet created, build it with
Tag the image for the container registry:docker tag myimage mycompany.registry.jetbrains.space/p/projectkey/mydocker/myimagehere
myimageis 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.
Publish the image to the registry:docker push mycompany.registry.jetbrains.space/p/projectkey/mydocker/myimage
Publish images from JetBrains TeamCity
Connect TeamCity instance with the Packages registry:
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 service account credentials.
Add Docker support to your TeamCity build configuration: In the build configuration settings, choose Build Features | Add build feature.
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.
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.
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