From 8dfe8013892825c16dfce70905c4bf0c422b0a14 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Tue, 10 Dec 2024 15:28:35 -0800 Subject: [PATCH] Ubuntu instructions for settign up docker to run the back end test suite --- backend/README.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index b7eedf398..1aa35a826 100644 --- a/backend/README.md +++ b/backend/README.md @@ -21,4 +21,66 @@ http://localhost:8080/MJUNKIN_1/VDYP-File/1.0.0/swagger.json ``` Note that if you have configured the `host` to be something other than localhost, the calls through -swagger-ui will be directed to that host and not localhost! \ No newline at end of file +swagger-ui will be directed to that host and not localhost! + +## Docker + +Docker is required to run the back end test suite. + +### Install on Ubuntu + +#### Remove old versions + +``` +for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt remove $pkg; done +``` + +#### Set up Docker APT repo + +``` +# Add Docker's official GPG key: +sudo apt update +sudo apt install ca-certificates curl +sudo install -m 0755 -d /etc/apt/keyrings +sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc +sudo chmod a+r /etc/apt/keyrings/docker.asc + +# Add the repository to Apt sources: +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get update +``` + +#### Install Docker + +``` +sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +``` + +#### Verify install + +``` +sudo docker run hello-world +``` + +This should sdownload a container and run it showing a confirmation message that docker is working. + +#### Set user permissions + +``` +sudo groupadd docker +sudo usermod -aG docker $USER +``` + +Log out and back in + +#### Verify permissions are working + +``` +docker run hello-world +``` + +This should work the same way as it did without `sudo`. +