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

Tuesday, February 11, 2020

Unable to upload WAR file into Nexus, Not Authorized error

 Unable to upload WAR file into Nexus,  Not Authorized error 


Root cause and Fix:
Make sure you are using right credentials for Nexus which is admin/admin123, and also you need to select from drop down. And also make sure you select Nexus 3 if you are using Nexus3.

Not authorized. Please check the properties sonar.login and sonar.password


Not authorized. Please check the properties sonar.login and sonar.password




root cause and fix:

SonarQube token was not setup correctly. You need to login in SonarQube as an administrator and create token. Copy the token in Jenkins --> Manage Jenkins--> sonarqube section and re-run the build.

Monday, February 3, 2020

Setup Artifactory on Ubuntu 16.0.4 using Docker - Install JFrog Artifactory on Ubuntu

Artifactory is one of the popular Binary repository manager. It is Java based tool, used for storing artifacts. Artifactory can be integrated with many Continuous integration and Continuous delivery tools. Artifactory is mainly used by Ant, Maven and Gradle build tools.

Let us see how to configure Artifactory on Ubuntu 16.0.4 using Docker. We will configure Artifactory by doing the three steps:

1. Install Docker on Ubuntu 16.0.4
2. Download Artifactory image
3. Spin up a container using the Artifactory image 

1. Install Docker on Ubuntu

Install packages to allow apt to use a repository over HTTPS:

sudo apt -y install apt-transport-https ca-certificates curl software-properties-common

Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add stable repository:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install Docker CE:
sudo apt update && sudo apt -y install docker-ce

If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:
sudo usermod -aG docker $USER

Run the command below to see a version of docker installed.
docker version
 Client:
 Version:           18.09.6
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        481bc77
 Built:             Sat May  4 02:35:27 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Step 2: Download Artifactory Docker image

There are different editions of JFrog Artifactory available, let us use open source version.

Pull the latest Docker image of JFrog Artifactory.
sudo docker pull docker.bintray.io/jfrog/artifactory-oss:latest

Display docker images
sudo docker images

Step 3: Create Data Directory

Create data directory on host system to ensure data used on container is persistent.
sudo mkdir -p /jfrog/artifactory
sudo chown -R 1030 /jfrog/

Step 4: Start JFrog Artifactory container

To start an Artifactory container, use the command:
sudo docker run --name artifactory -d -p 8081:8081 \
 -v /jfrog/artifactory:/var/opt/jfrog/artifactory \
   docker.bintray.io/jfrog/artifactory-oss:latest
 

Step 5: Run Artifactory as a service

sudo vim /etc/systemd/system/artifactory.service
 
# Copy the below code highlighted in green 
[Unit]
Description=Setup Systemd script for Artifactory Container
After=network.target

[Service]
Restart=always
ExecStartPre=-/usr/bin/docker kill artifactory
ExecStartPre=-/usr/bin/docker rm artifactory
ExecStart=/usr/bin/docker run --name artifactory -p 8081:8081 \
  -v /jfrog/artifactory:/var/opt/jfrog/artifactory \
  docker.bintray.io/jfrog/artifactory-oss:latest
ExecStop=-/usr/bin/docker kill artifactory
ExecStop=-/usr/bin/docker rm artifactory

[Install]
WantedBy=multi-user.target 

Reload Systemd
sudo systemctl daemon-reload

Then start Artifactory container with systemd.
sudo systemctl start artifactory
 
Enable it to start at system boot.
sudo systemctl enable artifactory

Check whether Artifactory is running?
sudo systemctl status artifactory

Step 6: Access Artifactory Web Interface

http://server_url:8081/artifactory

You should see Artifactory welcome page.

 

Thursday, January 2, 2020

Challenges in DevOps - Top 10 challenges in implementing or adopting DevOps - DevOps Challenges

DevOps...It is no more a buzzword..You hear this word pretty much every day during your coffee break at work :-)

Transforming to DevOps requires a change in culture and mindset. One of the key benefits of DevOps is to remove silos (the communication barriers between teams) between development and ops teams.  Adopting DevOps to an organization always comes with a lot of challenges. Transitioning to DevOps requires a change in culture & mindset and much more. Let's look at the top 10 challenges and identify ways to overcome them.

  1. Cultural change, change in the mindset - Cultural change is the first hurdle any company needs to overcome quickly for adopting devops fully. People should be bit open and welcome this new process change for embracing devops.
  2. Not driven top-down, it should be bottom-up - Adoption should come up from ground up, can’t be a top down initiative. Devops starts with a couple of developers and ops folks working together on automation.
  3. New tools.. new skills - Learning and Adapting to new set of tools are the key for practicing devops. Teams also should be open for hiring resources with CI/CD and devops skills if they don’t have one.
  4. Not picking the right project to get started - It is better to find an existing application or small product (that has full SDLC life cycle) to remodel it into devops in incremental baby steps, earning small but solid wins along the way. This gives confidence to the teams.
  5. Not moving away from legacy systems and infrastructure - By migrating monoliths into microservices architecture with automation and continuous delivery can bring faster development.
  6. Business expecting quick results after DevOps adoption - Devops change does not happen overnight, it must be smooth and gradual. Business should have some patience to see results.
  7. Not automating fully - Pipeline with leaks - Automation should be 100 percent. Pipelines also should integrate with code quality tools such as SonarQube. By doing few things still manually would enable for human error and can slow things down.
  8. Not integrating QA automation in CI/CD pipelines - CI/CD pipeline is not fully complete without integrating QA automation execution. Both has to work together, not in silos.
  9. Dev and Ops team having completely separate tools set - Both dev and ops need to work together and identify the right tools set. Need to ensure that is aligned within the goals for the organization.
  10. Quantifying the impact to top management - This is probably the difficult challenge to overcome. Its first important to benchmark your current state. After that perform maturity assessment every two sprints and compare the results to see if there are any improvements. Looking at SonarQube dash board for reducing code quality defects. Also, scheduling a feedback session with actual users of the application to measure the success also helps.

Saturday, November 16, 2019

Difference between Jenkins and Azure DevOps(VSTS) - What is the difference between Jenkins and Azure DevOps

Area
Jenkins
Azure DevOps
Type
Continuous integration tool
Project management + CI/CD tool
Git repo setup
Not possible
Git and TFVC repo creation is possible
SonarQube
Can be integrated
Can be integrated
licensing
Open source, java based
Proprietary from Microsoft
Branching and Merging
Not supported
Supported
Tools integration
Through plug-ins
Through add-ons
Release management
Not supported fully
Fully supported
Slack integration
Possible
possible

Complete AI-Enabled DevOps Learning Roadmap for 2026 | Skills Required to Become a Modern DevSecOps Engineer

🚀  AI-Enabled DevOps Engineer Roadmap for 2026 The future belongs to AI-Enabled DevOps Engineers, not AI-only Engineers. Strong DevOps fund...