{"id":25545179,"url":"https://github.com/uncore-team/docker_containers","last_synced_at":"2026-04-12T18:03:08.167Z","repository":{"id":276358586,"uuid":"929047082","full_name":"uncore-team/docker_containers","owner":"uncore-team","description":"Scripts for building and managing docker containers with NVIDIA support and support for remote access via XRDP and SSH","archived":false,"fork":false,"pushed_at":"2025-03-17T17:56:41.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-30T08:56:34.557Z","etag":null,"topics":["docker","docker-compose","nvidia-docker","python","ros","ssh-server","xrdp"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uncore-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-07T17:56:36.000Z","updated_at":"2025-03-17T17:56:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"e624a1f3-b603-4f59-aa92-8c8b12fd9de9","html_url":"https://github.com/uncore-team/docker_containers","commit_stats":null,"previous_names":["uncore-team/docker_containers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uncore-team/docker_containers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncore-team%2Fdocker_containers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncore-team%2Fdocker_containers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncore-team%2Fdocker_containers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncore-team%2Fdocker_containers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uncore-team","download_url":"https://codeload.github.com/uncore-team/docker_containers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncore-team%2Fdocker_containers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006841,"owners_count":26084204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","nvidia-docker","python","ros","ssh-server","xrdp"],"created_at":"2025-02-20T08:18:07.865Z","updated_at":"2025-10-11T10:18:04.299Z","avatar_url":"https://github.com/uncore-team.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿\r\n# Docker Containers Scripts\r\n\r\nThis document contains descriptions of the `.sh` scripts developed for managing containers tailored for the [TYRELL project](https://babel.isa.uma.es/research/projects/tyrell/). Of course, there are more comprehensive and sophisticated systems for managing docker containers graphically, such as [portainer](https://www.portainer.io/), but these require a more significant learning curve compared to these scripts. Feel free to use, share or change them for your proposal.\r\n\r\n\u003e Our images are based on the [official NVIDIA images](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/cuda), supports SSH connections, and include a XRDP server for remote graphical connections. You can customize these base images by means of a file named `packages.sh` that can be used to install your particular software. Reader can check our \"builds\" opening some folder of this repo. For example, `build_20_ros1` builds a image based on ´nvidia/cuda:12.2.0-base-ubuntu20.04´ with `ROS1` support.\r\n\r\n\r\n## 1. **re-build.sh**\r\n\r\nThis Bash script automates the process of building a Docker image. It performs the following steps:\r\n\r\n- **Checks for the existence of the `image.txt` file:** If the file does not exist, the script stops and displays an error message.\r\n\r\n- **Reads the image name from `image.txt`:** Extracts the value of the `IMAGE_NAME` variable from the file.\r\n\r\n- **Checks if the image already exists:** If the image exists, the script:\r\n\r\n    - Finds and lists containers that depend on that image.\r\n\r\n    - Prompts for confirmation to stop and remove dependent containers.\r\n\r\n    - Prompts for confirmation to delete the existing image.\r\n\r\n- **Builds the new image:** Uses docker build to create the image with the specified name and tag.\r\n\r\n- **Lists available images:** Displays a list of Docker images available on the system.\r\n\r\n### Help Option (`-h` or `--help`)\r\n\r\nYou can add a help option to the script to display the above description.\r\n\r\n### Structure of the `image.txt` file\r\n\r\n```\r\nIMAGE_NAME=my_image_name\r\n```\r\n\r\n### How to Use\r\n\r\nRun the script without arguments to build the Docker image:\r\n\r\n```\r\n./rebuild.sh\r\n```\r\n\r\nUse the `-h` or `--help` option to display the help message:\r\n\r\n```\r\n$ ./rebuild.sh -h\r\n```\r\n\r\nPlease, refer to script [`play.sh`](#2-playsh) to start the built container.\r\n\r\n## 2. **generate_container.sh**\r\n\r\nThis Bash script automates the setup and configuration of a Docker container for a specific project. It performs the following tasks:\r\n\r\n- **Validates Input Arguments:** Ensures that exactly three arguments are provided: `\u003cproject name\u003e`, `\u003ccontainer name\u003e`, and `\u003cport prefix\u003e`.\r\n\r\n- **Checks for Required Files:** Verifies the existence of the `image.txt` file, which contains the Docker image name.\r\n\r\n- **Reads the Docker Image Name:** Extracts the `IMAGE_NAME` from the `image.txt` file.\r\n\r\n- **Checks if the Docker Image Exists:** Ensures the specified Docker image exists; if not, the script exits.\r\n\r\n- **Creates Project Directories:** Sets up the necessary directories for the project and container under `$HOME/docker/`.\r\n\r\n- **Generates Configuration Files:** Creates a config.txt file with project-specific details (e.g., `IMAGE_NAME`, `CONTAINER_NAME`, `PORTS_PREFIX`). If a `config.txt` already exists, it renames it to `config.bak`.\r\n\r\n- **Generates Docker Compose File:** Executes the `generate_compose.sh` script to create a `docker-compose.yml` file.\r\n\r\n- **Copies Files to the Container:** Copies files from a source directory (`scripts/root`) to the container's home directory, skipping files that already exist in the destination.\r\n\r\n### Help Option (-h or --help)\r\n\r\nYou can add a help option to the script to display a summary of its functionality.\r\n\r\n### How to Use\r\n\r\nRun the script with the required arguments to set up the Docker container:\r\n\r\n```\r\n./script_name.sh \u003cproject_name\u003e \u003ccontainer_name\u003e \u003cport_prefix\u003e\r\n```\r\n\r\nUse the -h or --help option to display the help message:\r\n```\r\n./script_name.sh -h\r\n```\r\n\r\n## 3. **play.sh**\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funcore-team%2Fdocker_containers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funcore-team%2Fdocker_containers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funcore-team%2Fdocker_containers/lists"}