dockergoogle-compute-engine

Google GCE Container OS docker.io URL format


I am trying to create a GCE instance using Container OS. It fails every time with two errors:

Aug 28 16:41:35 instance-20240828-163551 systemctl[995]: Failed to start docker-events-collector.service: Unit docker-events-collector.service not found.

...

Aug 28 16:41:35 instance-20240828-163551 konlet-startup[1005]: 2024/08/28 16:41:35 Launching user container 'docker.io/XXXXX/my-image:latest'

Aug 28 16:41:35 instance-20240828-163551 konlet-startup[1005]: 2024/08/28 16:41:35 Configured container 'instance-20240828-163551' will be started with name>

Aug 28 16:41:35 instance-20240828-163551 konlet-startup[1005]: 2024/08/28 16:41:35 Pulling image: 'docker.io/XXXXX/my-image:latest'

Aug 28 16:41:35 instance-20240828-163551 konlet-startup[1005]: 2024/08/28 16:41:35 Error: Failed to start container: invalid reference format

That's not the actual docker repo name above. That was an experiment to confirm that the Docker Hub URL format is the issue.

I am using the format docker.io//: which is the only thing I've found online. Why doesn't this work? What is the correct format?

Note, the image is public. That's not the issue.

Secondly, is that first error (Failed to start docker-events-collector.service: Unit docker-events-collector.service not found) innocuous?


Solution

  • Instead of using the format docker.io//:, try Uploading your Docker image to Artifact Registry,

    Check if the image is present by using this command gcloud compute images list

    Then using this command to deploy:

    gcloud compute instances create-with-container vm_name \
        --container-image docker_image
    

    The second error is for logs and events, once the instance is created we can debug further on this, let me know if you can deploy an instance first.

    As you have mentioned you are using format docker.io//: but official doc mentions docker.io/<full Docker image name\>

    For more information follow this official document.