Note: This article is intended for engineers who are working directly with Docker images, and involves use of a terminal. You only need to do this if you’re responsible for the Docker images that are being prepared for use in Virtual Labs!
Prior to taking these steps, we’ll create a service account for your team, which will allow you to push and pull images from the registry, as well as a private Docker registry on Google Cloud. This is likely in our shared Keybase directory.
Log into the Docker registry
Keybase.io (if you don’t have an account, please make one and follow your CSM! If you can’t find them, let us know and we’ll give you a link). Navigate to where you saved the keyfile and run this command:
$ cat [your-keyfile].json | docker login -u _json_key --password-stdin https://gcr.io
Push and pull an image
$ docker pull gcr.io/your-site-name/stable/ttyd-orion
To push an image, simply push instead of pull (as you might expect):
$ docker push gcr.io/your-site-name/stable/ttyd-orion
Move an image from local dev to the remote registry
Build your image
$ docker build -t your-image-name
Tag it with the Google Cloud registry prefix:
$ docker tag your-image-name gcr.io/your-site-name/your-image-name
$ docker push gcr.io/your-site-name/your-image-name
Maintaining multiple versions
$ docker tag your-image-name:latest your-image-name:v2
$ docker tag your-image-name:v2 gcr.io/your-site-name/your-image-name:v2
$ docker push gcr.io/your-site-name/your-image-name:v2
:v2 to the name of the image in the Virtual Labs dashboard.