This needs docker , docker-compose Installed
git clone -b main https://github.com/ariadata/dc-nexus.git && cd dc-nexus
mkdir -p data && chmod -R 777 data
cp .env.example .env
docker compose up -d
cat data/admin.password
To set up a proxy to Docker Hub:
For the blob storage
- Click the config (gear) icon.
- Navigate to 'Blob Stores'.
- Create a new Blob Store of type File.
- You can name it whatever you like, but a good choice is
docker-hub
.
- You can name it whatever you like, but a good choice is
- Click 'Create Blob Store'.
For the Security Realm
- Click Security > Realms
- Add the 'Docker Bearer Token Realm'
- Click 'Save'
For the repo itself
- Click 'Repositories'
- Click 'Create Repository' and select 'docker (proxy)'
- Give it some name (
docker-hub-proxy
) - Check 'HTTP' and give it a valid port (
8082
) - Check 'Allow anonymous docker pull'
- Under Proxy > Remote Storage, enter this url:
https://registry-1.docker.io
- Under Docker Index, select 'Use Docker Hub'
- Under Storage > Blob Store, select the blob store you created earlier (
docker-hub
) - Click 'Create Repository'
For Docker Desktop (Windows or macOS), open your Docker Preferences, and select 'Docker Engine'.
Add this sections into the json file /etc/docker/daemon.json
:
{
"insecure-registries": ["IP_ADDRESS:8082"],
"registry-mirrors": ["http://IP_ADDRESS:8082"]
}
{
"registry-mirrors": ["https://docker-proxy.domain.net"]
}
Apply & Restart
sudo systemctl restart docker && sudo systemctl daemon-reload
You can now pull images via your repository. If the image you want is not in your local repo, it'll be pulled from docker hub and cached into your repo for the default amount of time (24 hours) before being re-checked.
An example pull:
docker pull IP_ADDRESS:8082/ubuntu
For the blob storage
- Click the config (gear) icon.
- Navigate to 'Blob Stores'.
- Create a new Blob Store of type File.
- You can name it whatever you like, but a good choice is
docker-private
.
- You can name it whatever you like, but a good choice is
- Click 'Create Blob Store'.
For the repo itself
- Click 'Repositories'
- Click 'Create Repository' and select 'docker (hosted)'
- Give it some name (
docker-private
) - Check 'HTTP' and give it a valid port (
8083
) - Under Docker Index, select 'Use Docker Hub'
- Under Storage > Blob Store, select the blob store you created earlier (
docker-private
) - Click 'Create Repository'
Docker Config
Make sure you add the new url and port to the insecure-registries
section of the docker config.
Eg:
"insecure-registries": [
"IP_ADDRESS:8082",
"IP_ADDRESS:8083"
],
To connect to the repository, you will need to login using the docker cli:
docker login IP_ADDRESS:8083
You can then provide user credentials (eg. - the admin user will work).
When you build a docker impage you'd like to push to the private registry, be sure to prefix the image name with the registry url.
Example:
docker build -t IP_ADDRESS:8083/myimage:latest .
Once it has been built, you can push it to the registry:
docker push IP_ADDRESS:8083/myimage:latest
update composer.json
file in your project root directory and add the following lines in the:
"repositories": [
{
"type": "composer",
"url": "https://composer-proxy.youdromin.com/repository/composer-proxy/"
},
{
"packagist.org": false
}
]
in nexus side use This Link
for client side use this link
npm config --location=project set registry https://registry.npmmirror.com
npm config --location=global set registry https://registry.npmmirror.com
or
npm config --location=project set registry http://your-nexus-ip:8081/repository/npm-proxy/
if using nginx-proxy-manager :
# set a proxy domain https://nexus.your-domain.com
# path to http schema and ip then port 8081
# add these codes to advanced tab:
rewrite ^(.*)$ /repository/npm-proxy/$1;
if ($request_uri ~ ^/*$|^/[^/.]+$) {
return 404;
}