From d2a071062505254c91134e0a9ab5ad9156d5f458 Mon Sep 17 00:00:00 2001 From: Max Erenberg <> Date: Sat, 1 Jan 2022 01:03:31 -0500 Subject: [PATCH] add docs for container registry --- docs/index.md | 1 + docs/registry.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 61 insertions(+) create mode 100644 docs/registry.md diff --git a/docs/index.md b/docs/index.md index d75af3f..27f6e5f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,6 +8,7 @@ available to CSC members. * [CloudStack](cloudstack) - Virtual machines on demand. * [Virtual hosting](vhosts) - Domain name routing for websites. * [Kubernetes](kubernetes) - Easily deploy your Dockerized apps. +* [Registry](registry) - A place to store your Docker images. ## Getting Started diff --git a/docs/registry.md b/docs/registry.md new file mode 100644 index 0000000..f95ba6c --- /dev/null +++ b/docs/registry.md @@ -0,0 +1,59 @@ +# Registry +We are running an instance of [Harbor](https://goharbor.io/) at +[https://registry.cloud.csclub.uwaterloo.ca](https://registry.cloud.csclub.uwaterloo.ca). +Harbor is a container registry for uploading and downloading Docker images. + +## Resource Limits +As of this writing, each member is restricted to a project with a 25GB +storage quota. Multiple images may be pushed to a project. + +If you want more space, please send an email to syscom with a brief +justification. + +## Logging in to the website +Just visit +[https://registry.cloud.csclub.uwaterloo.ca](https://registry.cloud.csclub.uwaterloo.ca) +and press the 'Login via OIDC Provider' button. + +## Create a project +*After* you have logged in to Harbor, SSH into a CSC machine and run the +following: +```sh +ceo registry project create +``` +Now refresh the Harbor page; you should see a project whose name is your +username. You are an admin of this project, so you can invite other +Harbor users to it if you wish. + +## Logging in to the registry +From the Harbor UI, click the top left corner, click 'User Profile', and +copy the CLI secret. + +From your personal computer, login to the registry: +```sh +docker login registry.cloud.csclub.uwaterloo.ca +``` +Use your CSC username for the username; use the CLI secret you copied earlier +for the password. + +## Pushing an image +Once you have logged into the registry, you can start pushing your own images. + +Let's say you have an image which you created locally called +`myimage:0.1.0`. Create a new tag of your image for the CSC registry: +```sh +docker tag myimage:0.1.0 registry.cloud.csclub.uwaterloo.ca/your_username/myimage:0.1.0 +``` +(Replace `your_username` with your actual username.) + +Now push it: +```sh +docker push registry.cloud.csclub.uwaterloo.ca/your_username/myimage:0.1.0 +``` + +!!! tip + Keep your Docker images small. This speeds up your upload time, and makes + you less likely to reach your storage quota. + [Here](https://blog.codacy.com/five-ways-to-slim-your-docker-images/) are + some good suggestions; you can find plenty more online with a quick + Google search. diff --git a/mkdocs.yml b/mkdocs.yml index a52b135..9fdcf48 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,6 +6,7 @@ nav: - Virtual Hosting: vhosts.md - Kubernetes: kubernetes.md - SSH Tricks: ssh-tricks.md + - Registry: registry.md # pip install pymdown-extensions markdown_extensions: