diff --git a/.gitignore b/.gitignore index 5ba29d0..003de9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ # Debian packages *.deb + +# Containers registry blobs +data +link diff --git a/CHANGELOG.md b/CHANGELOG.md index 27628b4..31219de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- [PR-11](https://github.com/AGH-CEAI/aegis_docker/pull/11) - Added Container for PPA server. +- [PR-13](https://github.com/AGH-CEAI/aegis_docker/pull/13) - Added compose for containers registry. +- [PR-11](https://github.com/AGH-CEAI/aegis_docker/pull/11) - Added container for PPA server. - [PR-9](https://github.com/AGH-CEAI/aegis_docker/pull/9) - Added documentation for using toolbx containers in Ubuntu 22.04/24.04. - [PR-4](https://github.com/AGH-CEAI/aegis_docker/pull/4) - Added instructions how to handle `sudo` issues in toolbx. - [PR-1](https://github.com/AGH-CEAI/aegis_docker/pull/1) - Initial version of the Aegis development container. diff --git a/README.md b/README.md index daf5ee6..82f4eeb 100644 --- a/README.md +++ b/README.md @@ -31,16 +31,23 @@ toolbox list toolbox enter aegis_dev-latest ``` +--- + ### Private Packages Repo (PPA) -How to Set up private repo [here](utils/aegis_packages/README.md). +How to Set up private repo [here](./utils/aegis_packages/README.md). **Adding private repo** ```bash echo "deb [trusted=yes] http://192.168.0.100/debian ./" | tee -a /etc/apt/sources.list > /dev/null ``` +### Containers registry + +[Instructions how to use self-hosted container registry.](./utils/containers_registry/README.md) + +--- -#### Known issues: +### Known issues: ##### `sudo`: unable to resolve host `toolbox` / `toolbx` diff --git a/utils/aegis_packages/README.md b/utils/aegis_packages/README.md index b4b2f5f..8912f57 100644 --- a/utils/aegis_packages/README.md +++ b/utils/aegis_packages/README.md @@ -35,3 +35,6 @@ docker compose up -d ### Adding new packages Follow `Preparing packages` step and the list of packages will automatically update. + +--- +[Back to main README](../../README.md) diff --git a/utils/containers_registry/README.md b/utils/containers_registry/README.md new file mode 100644 index 0000000..035e22d --- /dev/null +++ b/utils/containers_registry/README.md @@ -0,0 +1,60 @@ +# Containers registry + +This service allows to self-host container registry for Podman/Docker. + +Based on [this](https://infotechys.com/host-your-own-podman-registry/) tutorial. + + +## Prepare the host +```bash +export REGISTRY_PATH=/var/lib/registry +sudo mkdir -p $REGISTRY_PATH +``` + +## Run the service +```bash +podman-compose up -d +# or +docker compose up -d +``` + +## Setup the clients +The easiest way is to provide the registry address manually: +```bash +sudo vim /etc/containers/registries.conf +``` + +Assuming that `HOSTNAME` is your host IP address: +``` +[[registry]] +location = "HOSTNAME:5000" +insecure = true +``` + +> [!WARNING] +> This configuration is NOT SAFE. Consider setting up proper SSL certificates before running on your machine. + +Restart the contenerization engine: +```bash +sudo systemctl restart podman +# or +sudo systemctl restart docker +``` + +## Use it + +### Push +```bash +podman images +podman tag localhost/example:latest HOSTNAME:5000/example:latest +podman push HOSTNAME:5000/example:latest +``` + +### Pull +```bash +podman pull HOSTNAME:5000/example:latest +podman images +``` + +--- +[Back to main README](../../README.md) diff --git a/utils/containers_registry/docker-compose.yml b/utils/containers_registry/docker-compose.yml new file mode 100644 index 0000000..c739cb1 --- /dev/null +++ b/utils/containers_registry/docker-compose.yml @@ -0,0 +1,10 @@ +services: + containers_registry: + image: docker.io/library/registry:2 + container_name: containers_registry + privileged: true + restart: always + ports: + - "5000:5000" + volumes: + - ./registry:/var/lib/registry