The IONOS Cloud Container Registry service allows you to manage Docker and OCI compatible registries for use by your managed Kubernetes clusters. Use a container registry to make sure you have a private registry to effectively support pulling images.
Endpoint: https://api.ionos.com/containerregistries
To make authenticated requests to the API, you must include a few fields in the request headers. Please find relevant descriptions below:
We use curl in our examples, as this tool is available on Windows 10, Linux and macOS. Please refer to our blogpost about curl on Windows if you encounter any problems:
Authorization
yes
string
HTTP Basic authorization. A base64 encoded string of a username and password separated by a colon. [email protected]:password
X-Contract-Number
no
integer
Users with more than one contract may apply this header to indicate the applicable contract.
Content-Type
yes
string
Set this to application/json.
200 OK - Successfully received the locations of a registry
id
string
The id of the object that has been retrieved.
locations
type
string
The type of the resource that has been retrieved.
collection
ref
URL (string)
URL to the object representation (absolute path)
curl --location \
--request GET \
'https://api.ionos.com/containerregistries/locations' \
--header 'Authorization: Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM=' \
--data-raw ''{
"id": "locations",
"type": "collection",
"href": "",
"items": [
{
"id": "de/fra"
}
]
}https://api.ionos.com/cloudapi/v6/locations
items
array
The location of the container registry
"id": "de/fra"
Once you have all the information about the available locations, you can check out the name of existing registries. The name you choose should be available and must not be already in use.
You can retrieve all the existing registries to check out the available names.
You can update the limit value to get specific registries.
200 OK - Successfully showed the list of registries
Once you have created a repository using the and performed all operations you can delete the repository completely. Since does not allow to delete the entire repository, you can use IONOS Container Registry's API call for deleting the repository.
To delete your repository, the registryId and repository name for the repository to be deleted must be provided.
You can get registryId through .
Delete the repository using the following curl command:
href
URL (string)
URL to the object representation (absolute path).
https://api.ionos.com/cloudapi/v6/locations
createdByUserId
string
The email ID of the user or service account that initiated the operation.
7ee77dcf-093f-48e6-9a14-161c73568589
location
string
The location of the resource.
es/vit
days
array
The days of the week selected.
Monday
limit
integer
The limit of the registries that have been retrieved
5
limit
number
The output value if specified in the request.
5
id
string
The ID of the fetched output.
locations
type
string
The type of the resource that has been retrieved.
collection
requestID is a8fb592e4-494c-11ed-b878-0242ac120002 and the sample registry_name is testregistryId
string
The ID of the registry to return. This is required.
8fb592e4-494c-11ed-b878-0242ac120002
repository_name
string
The name of the registry. It must be unique within the folder.
test
204 - No Content
The request was successfully fulfilled and there is no content in the body.
curl --location \
--request GET 'https://api.ionos.com/containerregistries/registries?limit=5' \
--header 'Authorization: Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM='' \
--data-raw ''{
"id": "registries",
"type": "collection",
"href": "",
"items": [
{
"id": "34341cbe-c06a-4f5f-8773-4ae677d85ba8",
"type": "registry",
"href": "",
"metadata": {
"createdBy": "[email protected]",
"createdByUserId": "7ee77dcf-093f-48e6-9a14-161c73568589",
"createdDate": "2022-09-05T17:44:52Z",
"state": "Running"
},
"properties": {
"name": "tue1608es",
"location": "es/vit",
"maintenanceWindow": {
"days": [
"Monday"
],
"time": "01:23:00+00:00"
},
"garbageCollectionSchedule": {
"days": [
"Sunday",
"Saturday"
],
"time": "19:30:00+00:00"
},
"storageUsage": {
"bytes": 0,
"updatedAt": "2022-09-05T17:46:06Z"
},
"hostname": "tue1608es.cr.es-vit.ionos.com"
}
}
],
"limit": 5,
"nextPageToken": "",
"_links": {
"next": "",
"self": "/registries?limit=5",
"previous": ""
}
}
curl --location \
--request DELETE 'https://api.ionos.com/registries/8fb592e4-494c-11ed-b878-0242ac120002/repositories/test' \
--header 'Authorization: Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM=' \
--data-raw ''
To delete your token, the registryId and tokenId to be deleted must be provided.
You can get registryId through and .
Delete the information about the token using the following curl command:
tokenIDregistryId
string
The ID of the registry to be deleted.
779f8e3c-d5c8-4359-8f85-c200fb89e97c
tokenId
string
TThe associated ID of the token to be deleted.
4b120b87-91ab-4ec2-8952-cc771a37bd08
204 - No Content
The action was successful and the response body is empty.
400 Bad Request - The request made is invalid or corrupted
404 Bad Request - Not Found
This way you can delete a particular token.
curl --location \
--request DELETE 'https://api.ionos.com/containerregistries/registries/779f8e3c-d5c8-4359-8f85-c200fb89e97c/tokens/b120b87-91ab-4ec2-8952-cc771a37bd08' \
--header 'Authorization: Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ==' \
--data-raw ''
{
"httpStatus": 400,
"messages": [
{
"errorCode": "123",
"message": "ad velit dolor dolore laboris"
},
{
"errorCode": "123",
"message": "tempor"
}
]
}{
"msg": "Not Found"
}You can get the information for a particular container registry. At this point, a hostname will be allocated to your registry. The registry hostname becomes a part of your image or your manifest or the repository name.
With the GET request, you can fetch the registry information by ID. The registryId must be provided. You can get it through .
registryId
string
The ID of the registry to return. This is required.
789f8e3c-d5c8-4359-8f85-c200fb89e97
200 OK - Successful operation
type
string
The type of resource.
registry
createdByUserId
string
The ID of the user or service account that initiated the operation.
400 Bad Request - The request made is invalid or corrupted
404 Not Found - The server did not find anything matching the request
This section shows you how to create a registry token. We assume the following prerequisite:
In this guide, we used test named repository to create registry tokens. Therefore, it is important that the you know your container registry name.
With the POST request, you get the registry token. You will need to provide registry ID:
curl --location \
--request GET 'https://api.ionos.com/containerregistries/registries/:789f8e3c-d5c8-4359-8f85-c200fb89e97c' \
--header 'Authorization: Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM=' \
--data-raw ''
{
"id": "8fb59000-494c-11ed-0242ac120002,
"type": "registry",
"href": "",
"metadata": {
"createdBy": "[email protected]",
"createdByUserId": "a5af0375-1c1d-4387-9ef1-6ee95d30e54a",
"createdDate": "2022-10-07T14:30:06Z",
"state": "Running"
},
"properties": {
"name": "demo",
"location": "de/fra",
"garbageCollectionSchedule": {
"days": [
"Sunday",
"Saturday"
],
"time": "19:30:00+00:00"
},
"storageUsage": {
"bytes": 0,
"updatedAt": "2022-10-07T14:40:20Z"
},
"hostname": "demo.cr.de-fra.test.com",
"apiSubnetAllowList": ["198.51.100.0/24", "203.0.113.1/32"]
}
}
{
"httpStatus": 400,
"messages": [
{
"errorCode": "123",
"message": "ad velit dolor dolore laboris"
},
{
"errorCode": "123",
"message": "tempor"
}
]
}
{
"httpStatus": 400,
"messages": [
{
"errorCode": "123",
"message": "ad velit dolor dolore laboris"
},
{
"errorCode": "123",
"message": "tempor"
}
]
}
8fb59000-494c-11ed-0242ac120002
createdDate
string
The date when the operation was initiated.
2022-10-07T14:30:06Z
state
string
The status of the registry.
Running
hostname
string
The allocated hostname for the particular registry.
demo.cr.de-fra.test.com
apiSubnetAllowList
array
The list of IP subnets that can access the registry.
198.51.100.0/24
200 OK - Successfully showed the list of registries
id
string
The id of the created token.
8fb592e4-494c-11ed-b878-0242ac120002
createdByUserId
string
The ID of the user or service account that initiated the operation.
409 - Conflict
If you want to push your local images to docker repository, you need to login to it using:
You need to enter the following options to login:
Hostname
Username
Password
For more information, refer to the the Docker Commands.
You can push the images to your registry by providing all required information. You can query registries and look at images manifest, discover tags, delete layers and delete manifest etc. In the Docker API calls:
You can use the name of registry
Authenticate the API calls with a token
To know more, explore the Docker Documentation. On the other hand, DCD uses an easy to opt passthrough feature which as discussed uses Basic Auth feature, so you dont need to use a separate authentication method for Data Center Designer (DCD).
curl --location \
--request POST 'https://api.ionos.com/containerregistries/registries/:789f8e3c-d5c8-4359-8f85-c200fb89e97c/tokens' \
--header 'Authorization: Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM=' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"name": "test",
"expiryDate": null,
"scopes": [
{
"name": "*",
"actions": [
"pull", "push", "delete"
],
"type": "repository"
}
]
}
}'
{
"id": "8fb592e4-494c-11ed-b878-0242ac120002",
"type": "token",
"href": "",
"metadata": {
"createdBy": "[email protected]",
"createdByUserId": "8hb792e4-494c-11ed-b878-0242ac120002",
"createdDate": "2022-10-08T15:56:04Z",
"state": "enabled"
},
"properties": {
"name": "test",
"scopes": [
{
"actions": [
"pull",
"push",
"delete"
],
"name": "*",
"type": "repository"
}
],
"expiryDate": null,
"status": "enabled",
"credentials": {
"username": "test",
"password": "148g592e4-494c-11ed-b878-0242ac120002"
}
}
}
{
"httpStatus": 409,
"messages": [
{
"errorCode": "0",
"message": "already exists: name is not available"
}
]
}docker login [OPTIONS] [SERVER]8fb59000-494c-11ed-0242ac120002
state
string
The status of the registry.
Running
hostname
string
The allocated hostname for the particular registry.
demo.cr.de-fra.test.com
Once you have fetched your required information, you can now create a new registry. For the registry, you can alter the days and time. You can also update the location based on the available container registry locations.
We assume the following prerequisites:
With the POST request, you can create a container registry.
You can update the limit value to get specific registries based on the limit value being passed.
200 OK - Successfully showed the list of registries
400 Bad Request - The request made is invalid or corrupted
To delete your container registry, destroying all container image data stored in it. The registryId must be provided. You can get it through .
Delete the registry using the following curl command:
name
string
The name of the registry. It must be unique within the folder.
Demo
days
array
The days of the week selected.
Monday
apiSubnetAllowList
array
The list of IP subnets that can access the registry. If this parameter is omitted, the registry will be accessible from any IP address.
198.51.100.0/24
createdDate
string
The date when the operation was initiated.
h2022-10-07T14:30:06Z
days
array
The days of the week selected.
Sunday, Saturday
apiSubnetAllowList
array
The list of IP subnets, in CIDR notation, that can access the registry. For single IPs a /32 mask can be used. Addresses without a mask will be assumed to carry a /32 mask.
198.51.100.0/24
Here, we do not get a hostname in the output because the host has not be allocated yet.
days
array
The days of the week selected.
Monday
time
string
The timestamp of creation of the registry
19:30:00+00:00
location
string
The location of the resource.
id
string
The ID of fetched output.
locations
type
string
The type of resource.
registry
createdBy
string
ID of the user or service account that initiated the operation.
de/fra
registryId
string
The ID of the registry to be deleted. It is a required field.
789f8e3c-d5c8-4359-8f85-c200fb89e97c
204 - No Content
The request was successfully fulfilled and there is no content in the body.
404 Bad Request - Not Found
This way you can delete the registry completely.
curl --location \
--request POST 'https://api.ionos.com/containerregistries/registries' \
--header 'Authorization: Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM=' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"garbageCollectionSchedule": {
"days": [
"Saturday",
"Sunday"
],
"time": "19:30:00+00:00"
},
"location": "de/fra",
"name": "demo",
"apiSubnetAllowList": ["198.51.100.0/24", "203.0.113.1/32"]
}
}'{
"id": "709y8e3c-d5c8-4359-8f85-c200fb89e87c",
"type": "registry",
"href": "",
"metadata": {
"createdBy": "[email protected]",
"createdByUserId": "a7af0375-1c1d-4387-9ef1-6eu95d30e74a",
"createdDate": "2022-10-07T14:30:06Z",
"state": "New"
},
"properties": {
"name": "demo",
"location": "de/fra",
"garbageCollectionSchedule": {
"days": [
"Sunday",
"Saturday"
],
"time": "19:30:00+00:00"
},
"storageUsage": {
"bytes": 0
},
"hostname": "",
"apiSubnetAllowList": ["198.51.100.0/24", "203.0.113.1/32"]
}
}{
"httpStatus": 400,
"messages": [
{
"errorCode": "123",
"message": "ad velit dolor dolore laboris"
},
{
"errorCode": "123",
"message": "tempo
}
]
}
curl --location \
--request DELETE 'https://api.ionos.com/containerregistries/registries/789f8e3c-d5c8-4359-8f85-c200fb89e97c' \
--header 'Authorization: Basic e3t1c2VybmFtZX19Ont7cGFzc3dvcmR9fQ==' \
--data-raw ''{
"msg": "Not Found"
}