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.

Pre-Requistes:

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:

DevOps Coaching Program Model Information | AWS Cloud Azure Cloud DevOps Coaching Program Model Information

Thanks for showing interest in learning DevOps. Believe it or not, anyone can become a successful DevOps engineer after finishing the excit...