How to Publish Docker Images on a Private Nexus Repository Using Jib Maven Plugin

How to create a Nexus repository manager using HTTP and how to set up a Docker repository to publish Docker images using the jib plugin.

In this exercise, we are going to learn how to publish Docker images to a private Nexus repository with the help of the Maven Jib plugin. Until recently, you had to install the Docker daemon on the box from where you want to generate Docker images. The Jib plugin allows you to build the Docker image without installing Docker daemon. This is important for build machines using task managers like Jenkins and Teamcity, as setting up Docker is another extraneous step.

There are certain occasions during which you may want to publish your images into a private repository instead of a public repository like Dockerhub. The Nexus repository manager comes into the picture here as it can host all types of artifacts starting from jar, Docker images, npm packages, and more. This exercise assumes you have basic knowledge about Docker and repositories. We will first set up the Nexus repository on a local box followed by setting up the build process to publish the image to the same nexus repository.


This glossary will help you with the related concepts in case you are completely unfamiliar. 


Docker is a lightweight container used for publishing apps with the entire ecosystem packaged in a single bundle.


Jib is a framework to build and compile Docker images with and without the Docker daemon available on system. There are two plugins available for this, one for Maven and the other for Gradle. In this exercise, we are going to use the Jib Maven plugin to publish a Docker image.

Nexus Repository Manager

Nexus Repository OSS is a repository manager tool, used for hosting various (Read more...)

*** This is a Security Bloggers Network syndicated blog from Sonatype Blog authored by Awkash Agrawal. Read the original post at: