Skip to content

Creating containers from a local image registry #242

Description

@k-gostev

From the Eclipse Kanto Dev Mailing list:

Q: From eduleen.talledo@fpt.com:

May I ask questions about kanto-cm?
We are currently creating a POC leveraging kanto-cm features.
However, we encountered issues over issues in our setup and stuck for a week already. 😄

Background:

  • In a our ubuntu vm, we have 2 containers.
    • container 1 = local docker registry
    • container 2 = container with kanto setup (eclipse leda)
  • We tried pulling feedercan from ghcr.io/eclipse/kuksa.val.feeders/dbc2val:v0.1.1.
    • Then we pushed it in our local docker registry tagged localhost:5000/feedercan:latest
    • Verified feedercan exist in localhost:5000/v2/_catalog.
  • When we do systemctl restart contianer-management.service in contianer 2 it cannot find it.
    • kanto-cm have errors.
    • time="2024-05-23T12:10:47.479274512Z" level=info msg="trying next host" error="failed to do request: Head "[http://localhost:5000/v2/feedercan/manifests/latest](http://localhost:5000/v2/feedercan/manifests/latest/)": dial tcp [::1]:5000: connect: connection refused" host="localhost:5000"
  • We also configured config.json to allow insecure_registries.
    image
  • I attached a small logfile in kanto-cm.
    image-2

My questions are:

  1. Can we pull images from our local docker registry?
  2. Where and how can we setup kanto-cm images.json file so that kanto-cm will read it after systemctl restart contianer-management.service?

==========================
A: from @dimitar-dimitrow:
Here are some instructions for setting up a local registry and then use it with kanto-cm:

kanto-cm create --ports 5000:5000 --e REGISTRY_STORAGE_DELETE_ENABLED=true --name registry docker.io/library/registry:latest
kanto-cm start -n registry
docker pull hello-world:latest
docker tag hello-world:latest localhost:5000/hello-world:latest
docker push localhost:5000/hello-world:latest
kanto-cm create -n hello --rp no localhost:5000/hello-world:latest
kanto-cm start --a -n hello

JSON files with container configurations are handled be the deployment sub-service within Kanto Container Management. The default directory is /etc/container-management/containers. It is configurable of course, you can check the doc and here are the default deployment values:

{
    "deployment": {
        "enable": true,
        "mode": "update",
        "home_dir": "/var/lib/container-management",
        "ctr_dir": "/etc/container-management/containers"
    }
}

=============================
Q: From eduleen.talledo@fpt.com:
I did the instructions below but still cannot pull like registry.

root@cf7c7fcl6dfe:/# kanto-cm create --ports 12345:5000 - -name registry docker.1o/library/registry:latest
FATA [2024 - 05 - 27T15: 40:14.788579804Z]
error while dialing /run/container-management/container-management.sock: context deadline exceeded

This is the container-management.log
image-3
This is my config.json.
image-4

After editing the config.json and creating dir in etc/container-management/containers.
I restarted container-management.service before running the command kanto-cm create.

I'm not sure what did I missed? 😄

Also does kanto-cm have its own registry?
If ever has, how to use it? (push, pull, etc).

Metadata

Metadata

Labels

help wantedExtra attention is neededquestionFurther information is requested

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions