Many companies/organizations lock down server's access to the internet. This simple project allows testing of centos configuration for yum pointing to nexus as a proxy. Verifies that centos is limited to only communicate to nexus repo. Thus allows yum.repos.d modification to be tested.
Takes Sonatype 3.9.0 docker image and a stand alone centos docker image. Creates 2 networks one has internet access and the other does not. The centos image is attached to "no-internet" network while the nexus image can communicate on both "internet" and "no-internet" network
This was created based on the document offered by sonatype. https://help.sonatype.com/repomanager3/yum-repositories
git clone https://github.com/doughoke/nexus-yum-isolated-test.git
Now go to the new directory and docker compose up.
cd nexus-yum-isolated-test
docker-compose up
The nexus repo should be running on http://localhost:8081
Login with: admin/admin123
Create Repository (select yum proxy)
Name the repo yum-centos
Set up your yum repo to point http://mirror.centos.org/centos/ (or whatever repo mirror you want)
ssh into the centos container
docker exec -it centos-no-internet /bin/bash
Once inside the container cd to /etc/yum.repos.d Back up existing .repo files 'mv *repo /tmp' Create a new repo file pointing to nexus (note use the sha of the nexus container - (get that from 'docker ps -a | grep nexus') Use the sample-nexus.repo file in the projet and replace string with instance id from the previous command. Save the .repo file
yum update
yum install zip
yum install docker ###fun to run docker in docker container