From f782997c98169300c40ddff882e1faa77387ba33 Mon Sep 17 00:00:00 2001 From: Matthew Bourque Date: Fri, 22 Aug 2025 12:00:25 -0600 Subject: [PATCH] Removed references to LASP image registry --- .../docker/beginner_guide_to_docker.md | 9 +- .../docker/containerizing_idl_with_docker.md | 28 +-- docs/source/workflows/docker/index.rst | 2 - .../workflows/docker/lasp_docker_registry.md | 170 ------------------ .../workflows/docker/lasp_image_registry.md | 121 ------------- 5 files changed, 16 insertions(+), 314 deletions(-) delete mode 100644 docs/source/workflows/docker/lasp_docker_registry.md delete mode 100644 docs/source/workflows/docker/lasp_image_registry.md diff --git a/docs/source/workflows/docker/beginner_guide_to_docker.md b/docs/source/workflows/docker/beginner_guide_to_docker.md index 13db679..23e81f1 100644 --- a/docs/source/workflows/docker/beginner_guide_to_docker.md +++ b/docs/source/workflows/docker/beginner_guide_to_docker.md @@ -41,8 +41,7 @@ useful if you will be running multiple images in tandem, attaching volumes or ne generally find yourself running the same commands for creating containers and want to optimize that. **Docker Registry:** A registry or archive store is a place to store and retrieve docker images. This is one way to -share already-built docker images. LASP has a private repository, in the form of the -[LASP docker registry](lasp_docker_registry). +share already-built docker images. LASP has a private repository, in the form of the LASP docker registry. So, you define a Docker *image* using a *Dockerfile* and/or a *Docker Compose* file. Running this image produces a Docker *container*, which runs your code and environment. An image can be pushed up to a *registry*, where anyone with @@ -143,10 +142,6 @@ has successfully exited with `docker ps -a`. The `CMD` is how most Docker contai intervention work. For an example of a system where that's operating, you can read the documentation on the [TIM tests in Docker](https://confluence.lasp.colorado.edu/display/DS/Containerize+TIM+Processing+-+Base+Image). -Next steps, beyond going more in depth with the TIM dockerfiles, would be to learn about using the [LASP docker -registry](lasp_docker_registry). Other topics include [Docker compose](docker_compose_examples), running Docker on -[M1 chips](running_docker_with_m1), and other pages under the [Docker Guidelines](index). - ## Docker Cheat Sheet Here is a list of Docker commands that might be useful to have as a shorthand: @@ -159,7 +154,7 @@ docker build --platform linux/amd64 -f -t :latest . docker run --platform linux/amd64 -it --name :latest # Login to docker registry -docker login docker-registry.pdmz.lasp.colorado.edu +docker login # View docker images docker images diff --git a/docs/source/workflows/docker/containerizing_idl_with_docker.md b/docs/source/workflows/docker/containerizing_idl_with_docker.md index ee03765..e806a56 100644 --- a/docs/source/workflows/docker/containerizing_idl_with_docker.md +++ b/docs/source/workflows/docker/containerizing_idl_with_docker.md @@ -19,7 +19,7 @@ This document provides a preliminary implementation of IDL in a Docker container * Provided that the host machine has LASP VPN access (for licensing purposes), the containerized IDL should work directly "out of the box" (i.e., no manual post-container creation steps are required). * Although both the IDL and IDLDE images can be built locally using the Dockerfiles below, they are also available from - the [LASP Image Registry](lasp_docker_registry). + the LASP Image Registry. ## Dockerfile @@ -42,7 +42,7 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* # Download IDL package, unarchive it, remove package, perform silent install using answer file -RUN curl -O https://artifacts.pdmz.lasp.colorado.edu/repository/datasystems/idl/installers/idl87.tar.gz \ +RUN curl -O \ && tar -xzf ./idl87.tar.gz && rm -f ./idl87.tar.gz \ && sh ./install.sh -s < ./silent/idl_answer_file @@ -139,7 +139,7 @@ The following demonstrates how to utilize IDL by directly interacting with a run (optional) container name is `idl_container` and the name of the (previously created) image is `idl_image`: ```bash -(base) MacL3947:idl stmu4541$ docker container run -it --name=idl_container idl_image +(base) MacL3947:idl $ docker container run -it --name=idl_container idl_image IDL 8.7.3 (linux x86_64 m64). (c) 2020, Harris Geospatial Solutions, Inc. @@ -150,7 +150,7 @@ https://harrisgeospatial.flexnetoperations.com IDL> print, ((cos(45.0d*(!PI/180.0d)))^2 + (sin(45.0d*(!PI/180.0d)))^2).tostring() 1.0000000000000000 IDL> exit -(base) stmu4541@MacL3947:~/projects/docker/idl$ +(base) @:~/projects/docker/idl$ ``` ## Cross-container Access @@ -293,13 +293,13 @@ OS. Create an IDL container named `idl_container` from the `idl_image` image generated by the Dockerfile included above, and include a bind mount to a directory on the host machine. In this example, the host directory is -`/Users/stmu4541/projects/docker/src`, and is bind mounted to a directory named `/src` in the IDL container: +`/Users//projects/docker/src`, and is bind mounted to a directory named `/src` in the IDL container: ```bash -docker container run -d -v /Users/stmu4541/projects/docker/src:/src --name=idl_container idl_image +docker container run -d -v /Users//projects/docker/src:/src --name=idl_container idl_image ``` -The container is named `idl_container`, and the `/Users/stmu4541/projects/docker/src` directory on the host is bind +The container is named `idl_container`, and the `/Users//projects/docker/src` directory on the host is bind mounted to the `/src` directory in the container. Now create the non-IDL container named `centos_container`: @@ -307,7 +307,7 @@ Now create the non-IDL container named `centos_container`: ```bash docker container run --rm -it \ --name=centos_container \ - -v /Users/stmu4541/projects/docker/src:/src \ + -v /Users//projects/docker/src:/src \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /usr/bin/docker:/usr/bin/docker \ lentos bash @@ -316,10 +316,10 @@ docker container run --rm -it \ Here, `lentos`, which immediately precedes the bash command specifies the official `centos` image. The three bind mounts are identical to those described in Solution 1 except that the named volume mount (`SharedData`) -has been replaced by a bind mount to a directory (`/Users/stmu4541/projects/docker/src`) on the host machine. +has been replaced by a bind mount to a directory (`/Users//projects/docker/src`) on the host machine. -The `/Users/stmu4541/projects/docker/src` directory on the host machine, and the `/src` directories on both containers -refer to the same file system. In other words, any file that resides in the `/Users/stmu4541/projects/docker/src` host +The `/Users//projects/docker/src` directory on the host machine, and the `/src` directories on both containers +refer to the same file system. In other words, any file that resides in the `/Users//projects/docker/src` host directory or the `/src` directory in the non-IDL container, is visible to the `/src` directory of the IDL container. ## Jenkins as the Non-IDL Container @@ -381,18 +381,18 @@ As always, this image build command must be run in the same directory as the rel #### Pull the IDLDE Image from the LASP Image Registry The image can be built locally using the above Dockerfiles and the `docker image build` command, or it can be obtained -from the [LASP Image Registry](lasp_docker_registry). To pull the image, log into the LASP Image Registry and use the +from the LASP Image Registry. To pull the image, log into the LASP Image Registry and use the `pull` command: ```bash -docker pull docker-registry.pdmz.lasp.colorado.edu/tsis/idlde_centos7:latest +docker pull /tsis/idlde_centos7:latest ``` I recommend re-tagging the image for convenience (this will not create an additional copy of the image, it acts more like a symbolic link to the same image): ```bash -docker image tag docker-registry.pdmz.lasp.colorado.edu/tsis/idlde_centos7 idlde_image +docker image tag /tsis/idlde_centos7 idlde_image ``` #### Run the Containerized IDLDE on Linux diff --git a/docs/source/workflows/docker/index.rst b/docs/source/workflows/docker/index.rst index 55ce061..5d94b7d 100644 --- a/docs/source/workflows/docker/index.rst +++ b/docs/source/workflows/docker/index.rst @@ -9,7 +9,5 @@ Docker docker_compose_examples export_display_with_docker jenkins_job_builder - lasp_docker_registry - lasp_image_registry multi_stage_builds running_docker_with_m1 \ No newline at end of file diff --git a/docs/source/workflows/docker/lasp_docker_registry.md b/docs/source/workflows/docker/lasp_docker_registry.md deleted file mode 100644 index b7528ad..0000000 --- a/docs/source/workflows/docker/lasp_docker_registry.md +++ /dev/null @@ -1,170 +0,0 @@ -# LASP Docker Registry - -## Purpose for this guideline - -This document provides guidelines on how to use the LASP Docker registry for publishing and accessing Docker images. - -## Overview - -The Web Team manages an on-premises Docker registry exclusively used by LASP. The purpose of this registry is to enable -teams within LASP to publish and access Docker images. These Docker images can be created ad-hoc or in an automated -fashion using a Dockerfile located in a corresponding Bitbucket repository. Additionally, the registry can be made -available for access from the internet, behind WebIAM authentication to be used by cloud resources such as AWS. - -The LASP Docker Registry is the Sonatype Nexus Repository Pro version. It runs in the DMZ and is behind WebIAM user -authentication. - -## Accessing the Registry - -The Web UI for Nexus is located at [https://artifacts.pdmz.lasp.colorado.edu](https://artifacts.pdmz.lasp.colorado.edu). -It is not necessary to log into the server to search and browse public repositories using the left-hand navigation menu. - -> **Warning**: The UI is only accessible from inside the LASP Network. - -The internal URL for the Docker repository when using Docker `push`/`pull` commands is -`docker-registry.pdmz.lasp.colorado.edu`. The same repository can also be accessed externally at -`lasp-registry.colorado.edu`. - -The difference in URLs is that the Nexus server is intended to be used for different types of artifacts that can be -served and managed via HTTPS. The Docker registry is a special repository and is running on a different port and -protocol. It cannot be accessed via HTTPS. - -The LASP Docker registry can be accessed outside the LASP Network using Docker CLI commands (i.e `docker push` or -`docker pull`) by the URL `lasp-registry.colorado.edu`. This allows users to access Docker images from AWS, for example. - -## Namespaces - -The LASP Docker registry is organized by Namespaces. This is just a sub-folder or path that is used to group all related -images together. Namespaces can be organized by teams or missions. Once a Namespace has been identified, ACLs will be -created in Nexus that allow only specific WebIAM groups to create or push images to the Registry as well as delete -images. Images will be referred to in Docker as `/:` or more precisely -`//:`. See [Creating an Image](#creating-an-image) below for more information. - -## Browsing Images - -Access the Web UI via the URL above. Click on **Browse**: - -![Browse for images](../../_static/lasp_docker_registry_browse1.png) - -Click **"lasp-registry"**: - -![Browse for images](../../_static/lasp_docker_registry_browse2.png) - -Pick a team or project and expand it. Here you can see the available images under the "web" Namespace: - -![Browse for images](../../_static/lasp_docker_registry_browse3.png) - -> **Info**: Each Layer of a Docker image is composed of "Blobs". These are kept outside of the Namespace, but are -> referenced and used by the manifests. - -You can find each available tag and its relevant metadata here. - -## Creating an Image - -### Manually - -1. From the root directory where your Dockerfile lives, build a local image specifying an image name and tag (i.e. - `image_name:tag_version`): - -```bash -$ docker build --force-rm -t webtcad-landing:1.0.2 . -Sending build context to Docker daemon 22.78 MB -Step 1 : FROM nginx:1.12.2 - ---> dfe062ee1dc8 -... -... -... -Step 8 : RUN chown -R nginx:nginx /usr/share/nginx/html && chown root:root /etc/nginx/nginx.conf - ---> Running in 8497cc7f30ed - ---> 28cb8c0df12b -Removing intermediate container 8497cc7f30ed -Successfully built 28cb8c0df12b -``` - -2. Tag your new image with the format `//image_name:tag`: - -```bash -$ docker tag 28cb8c0df12b docker-registry.pdmz.lasp.colorado.edu/web/webtcad-landing:1.0.2 -``` - -> **Info**: Note the "web" namespace in the URL above. This will change depending on your particular Namespace. - -3. Login to the remote registry using your username/password: - -```bash -$ docker login docker-registry.pdmz.lasp.colorado.edu -Username: -``` - -4. Push the image into the repository/registry: - -```bash -$ docker push docker-registry.pdmz.lasp.colorado.edu/web/webtcad-landing:1.0.2 -``` - -5. Logout of the registry when complete. This removes credentials stored in a local file. - -```bash -$ docker logout -``` - -> **Info**: Don't forget to delete your local images if you no longer need them. - -### Automated - -To script the process of creating an image, you can use something like Ansible with its -["docker_image"](https://docs.ansible.com/ansible/latest/collections/community/docker/docker_image_module.html) module -or something simple as a build script in your Bitbucket repo or Jenkins Job with the above commands invoked in a Shell -Builder. The Web Team utilizes all three methods when creating images. - -## Deleting - -Although deleting a Docker image can be done via API commands against the registry, it is best done via the Web UI. To -do so, login to the Registry and then Browse to the particular image:tag you wish to delete: - -![Delete an image](../../_static/lasp_docker_registry_delete_image1.png) - -Click the "Delete Asset" button. - -If you no longer need that particular image at all, you can delete the folder associated with it by selecting the folder -and clicking "Delete Folder": - -![Delete an image](../../_static/lasp_docker_registry_delete_image2.png) - -## Pulling an Image - -1. Login to the remote registry using your username/password. Note that this is only necessary if you are accessing a - docker image that is NOT in a public namespace: - -```bash -$ docker login docker-registry.pdmz.lasp.colorado.edu -Username: -``` - -2. Pull the image from the repository/registry: - -```bash -$ docker image pull docker-registry.pdmz.lasp.colorado.edu/web/webtcad-landing:1.0.2 -``` - -3. Logout of the registry when complete. This removes credentials stored in a local file: - -```bash -$ docker logout -``` - -## Requesting Access - -Write access and new Namespaces require The Web Team to create WebIAM groups and Nexus ACLs. Please submit a Jira -WEBSUPPORT ticket or send an email to `web.support@lasp.colorado.edu` - -## Acronyms - -* **AWS** = Amazon Web Services -* **CLI** = Command-Line Interface -* **DMZ** = DeMiliterized Zone -* **HTTPS** = HypterText Transfer Protocol Secure -* **UI** = User Interface -* **URL** = Uniform Resource Locator - -*Credit: Content taken from a Confluence guide written by Maxine Hartnett* diff --git a/docs/source/workflows/docker/lasp_image_registry.md b/docs/source/workflows/docker/lasp_image_registry.md deleted file mode 100644 index bd125e2..0000000 --- a/docs/source/workflows/docker/lasp_image_registry.md +++ /dev/null @@ -1,121 +0,0 @@ -# LASP Image Registry - -## Purpose for this guideline - -This document provides instructions on how to push and pull Docker images to/from the LASP image registry. - -## Overview - -LASP has established its own image registry, `docker-registry.pdmz.lasp.colorado.edu`, and, in general, does not rely on -Docker Hub. The web team has granted access privileges to the Nexus repositories, including the Docker image registry, -using WebIAM credentials. For more info about accessing the LASP Image registry, check out the [LASP Docker registry -page](lasp_docker_registry). - -The url for access to the LASP image registry is -[https://artifacts.pdmz.lasp.colorado.edu](https://artifacts.pdmz.lasp.colorado.edu). - -## Push an image to the registry - -### Retag the image - -First, it is necessary to retag the image to include the registry name and registry account. In general, this is: - -```bash -docker-registry.pdmz.lasp.colorado.edu//: -``` - -A specific example, using a current TIM development image is - -```bash -docker image tag dsinteg2_migration docker-registry.pdmz.lasp.colorado.edu/tsis/dsinteg2_migration -``` - -where `tsis` is the registry account name assigned to this project by the web team. - -### Log into the registry - -Before the image can be pushed to the LASP image registry, a connection must be established as follows: - -```bash -docker login -u -p docker-registry.pdmz.lasp.colorado.edu -``` - -For example: - -```bash -docker login -u smueller -p docker-registry.pdmz.lasp.colorado.edu -``` - -If the connection fails, try enclosing the password with double quotes. - -### Push the image to the registry - -Push the image to the registry as follows: - -```bash -docker push docker-registry.pdmz.lasp.colorado.edu//: -``` - -For example: - -```bash -docker push docker-registry.pdmz.lasp.colorado.edu/tsis/dsinteg2_migration -``` - -The registry account name is set by the web team, and they refer to it as the namespace. - -## Pull the image from the registry from the command line - -To pull a registry image, simply include the registry address (`docker-registry.pdmz.lasp.colorado.edu`), the project -account name (e.g. `tsis`), followed by the image name (e.g. `dsinteg2_migration`). - -For example: - -```bash -docker pull docker-registry.pdmz.lasp.colorado.edu/tsis/dsinteg2_migration -``` - -Or, the following command: - -```bash -docker container run --user root --rm -it \ - --name timDevContainer \ - docker-registry.pdmz.lasp.colorado.edu/tsis/dsinteg2_migration \ - bash -``` - -This will launch a container based on the registry `dsinteg2_migration` image and connect to that container with a -`bash` shell. - -## Pull the image from the registry in the Docker compose file - -Referencing the registry image in the Docker compose file is simple. Just use the new tag name, that now includes the -registry and account name, in the image specification. For example: - -```yaml -more docker-compose.yml -version: '3' - -services: - timDev: - image: docker-registry.pdmz.lasp.colorado.edu/tsis/dsinteg2_migration - restart: unless-stopped - volumes: - - /home/stmu4541/projects/tsis_tim/tim_processing/timDev/jenkins/data:/var/jenkins_home - ports: - - 8082:8080 -``` - -Only the image argument is relevant to the registry pull. - -## Useful Links - -* [Official Docker documentation](https://docs.docker.com/) -* [LASP image registry](https://artifacts.pdmz.lasp.colorado.edu) - -## Acronyms - -* **TIM** = Total Irradiance Monitor -* **URL** = Uniform Resource Locator - -*Credit: Content taken from a Confluence guide written by Steven Mueller*