Coder Social home page Coder Social logo

jnk-dkr-nexus's Introduction

Jenkins-Docker-Nexus

A tutorial for building a docker image in jenkins and push to nexus artifactory

  • note: this tutorial needs a jenkins build agent with docker installed, as the jenkinsfile targeting this type of agent.
    • edit the jenkinsfile agent label to 'any' if you have docker installed on your only agent.
  1. Fork this repo.
  2. Run the following command to have a running nexus container with extra ports (you only needs the 8081 [UI] and 8082,8083 [docker repo / https]).
docker run -d -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 8084:8084 --name nexus sonatype/nexus3
  1. Configure nexus and add a 'docker (hosted)' repo. (see guide below)
https://blog.sonatype.com/using-nexus-3-as-your-repository-part-3-docker-images
  1. Create credentials in jenkins to hold a secure 'user:password' for your nexus.
  2. Create a declarative pipeline in jenkins and point to the forked repo with the jenkinsfile within it.
https://help.sonatype.com/repomanager3/formats/docker-registry/pushing-images
  1. Edit the jenkinsfile to match your repos and credentialsID in lines 12, 32, 67, 69, 72.

  2. Commit & push the changes to your forked repo.

  3. Run the job and anter it:

    • It will wait and ask you to enter a tag for the docker build.
    • At the end will ask to continue with upload to the nexus artifactory.
  4. You can browse your nexus to see the blob data and docker image uploaded to the registry.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.