This article is a memo for myself, so it is not well-formatted. Please note.
It is necessary to deal with the following cases, and to output the procedure etc.
--Digdag, Embulk Have the Docker Image for server construction shared (on Docker Hub) and --Use it to set up a GCP VM and build a server
-Container Registry Quick Start --This document describes "How to push Docker Image prepared locally in Container Registry" and "How to pull Docker Image from Container Registry". --In this article, I referred to the former part. -Using Container Registry with Google Cloud -Start Docker container via Cloud-Config --Create and configure instance
docker
command without sudo
by restarting sudo usermod -a -G docker $ {USER}
+This time, I will use busybox as an example.
docker pull busybox:latest
# check image
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 6d5fcfe5ff17 8 months ago 1.22MB
Below, quoted from the reference page
To push or pull an image, you need to configure Docker to authenticate requests to Container Registry using the gcloud command-line tool. To do this, run the following command (you only need to run it once):
gcloud auth configure-docker
docker push
normally pushes to Docker Hub. If you want to push to a specific location, it seems to be controlled by rewriting the registry name tag.
Quoted from the reference page
Before you can push a Docker image to Container Registry, you need to tag the image with the registry name. When you tag a Docker image with a registry name, the docker push command is configured to push the image to a specific location. In this quickstart, the host location is gcr.io. To tag the Docker image, run the following command:
docker tag busybox gcr.io/[PROJECT-ID]/busybox:v1
# check img
REPOSITORY TAG IMAGE ID CREATED SIZE
gcr.io/[PROJECT-ID]/busybox v1 6d5fcfe5ff17 8 months ago 1.22MB
docker push gcr.io/[PROJECT-ID]/busybox:v1
* Consider a case where VM is started once with GUI </ font>
From the GCP dashboard screen, move to the VM instance startup screen by following the flow ComputeEngine-> VM instance
.
On the VM startup screen, enter that an instance will be created from the container image (see the figure below).
In container image
, describe the path of the container image pushed in advance as described in the example.
When specifying the container image stored in ContainerRagistry, the path will be gcr.io / ...
.
All you have to do is press the VM instance creation button.
According to Using Container Registry with Google Cloud (https://cloud.google.com/container-registry/docs/using-with-google-cloud-platform)
gcloud container images delete gcr.io/[PROJECT-ID]/busybox:v1 --force-delete-tags
I heard that it can be executed with, but I could not delete Docker Image from the gcloud
command due to the following error.
ERROR: (gcloud.container.images.delete) [gcr.io/[PROJECT-ID]/busybox:v1] is not a valid name. Expected tag in the form "base:tag" or "tag" or digest in the form "sha256:<digest>"
(Currently under investigation ...)
This time, delete the corresponding image of GCR from Google Cloud Console.
I'm going, but I can't find it. .. .. .. (?)
Delete the VM instance in the Google Cloud Console.
Recommended Posts