Tuesday, February 25, 2020

How to upload Docker images into Nexus docker Registry | Upload Docker images to Nexus Decker Registry

How to upload Docker images into Nexus docker Registry - Upload Docker images to Nexus Decker Registry.


Make sure Docker is installed and up and running.
Nexus is up and running and Docker registry is already is configured. If you have not yet, click here to setup Nexus 3 to configure as Docker Registry.

Steps to configure in Docker to upload Docker images to Nexus:

Configure Docker service to use insecure registry with http.Create Docker daemon file if it does not exist.

sudo vi /etc/docker/daemon.json
Add entries like below:
Enter NExus URL along with port number used for Docker registery

    "insecure-registries" : ["nexus_public_dns_name:8085"]

Restart Docker daemon after above configuration changes.

sudo systemctl restart docker

Make sure Docker was able to restart successfully.

Login to Docker Registry hosted in Nexus 3

Make sure you are able to login to Docker Registry hosted in Nexus by executing below command:
sudo docker login -u admin nexus_public_dns_name:8085
and then enter nexus admin password

Download Dockerized code from my repo

git clone https://bitbucket.org/ananthkannan/mydockerrepo; cd mydockerrepo/pythonApp

Create a Docker image and tag the image per Nexus Registry
sudo docker build . -t nexus_public_dns_name:8085/mypythonimage

Push the image into Docker Registry
sudo docker push nexus_public_dns_name:8085/mypythonimage

Verify in Nexus if images are uploaded
Login to Nexus, click on Browse, choose Docker registry

1 comment:

Automate Azure App Service setup using Ansible and Azure DevOps pipeline | How to integrate Ansible with Azure DevOps | How to Create WebApp in Azure Cloud using Ansible

Ansible is an open-source, configuration management tool that automates cloud provisioning, configuration management, and application deploy...