Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

      We will use vfc-nfvo-lcm(python project) as a sample to describle how to build docker image for vfc components.

  1. write a Dockerfile
    1) create a directory named docker in base repo( you can ref to vfc/nfvo/lcm/docker )
    2) In the docker directory, you need add the following files( you can ref to vfc/nfvo/lcm/docker/* )
        build_image.sh     note: the file is called by script in jjb of ci-management
        docker-entrypoint.sh   note: the file is used as ENTRYPOINT of Dockerfile
        Dockerfile   note: the file is used by docker build command(if the repo is a java project, you should add jdk and tomcat in apt-get install)
       instance_config.sh  note: this file is called by docker-entrypoint.sh to config parameters when docker is created.
       instance_init.sh   note: this file is called by docker-entrypoint.sh to do one-time initialization when docker is created.
       instance_run.sh  note: this file is called by docker-entrypoint.sh to start your service when docker is created.
       LICENSE note: because we do not add license header in the above sh files, so we need add this license file.
       node: before you commit your file, you should use "git update-index --chmod=+x <file>" command to add execute permission to the above sh files.
                 and you can use "git ls-files --stage <file>" to confirm the <file>'s execute permission.(note 100755 is ok, while 100644 is not ok)
  2. create jjb in ci-management
    1) enter ci-management/jjb/vfc
    2) add build-<name>-docker-image.sh( you can ref to build-nfvo-lcm-docker-image.sh)
    3) add docker-java-version-shell-daily to ymal file( you can ref to vfc-nfvo-lcm-java.yaml)
       - '{project-name}-{stream}-docker-java-version-shell-daily':

          docker-pom: 'pom.xml' 
          mvn-goals: 'install'
          script:
              !include-raw-escape: 'build-nfvo-lcm-docker-image.sh'  

  3. Add a version.properties file in your base repo(ref to vfc/nfvo/lcm/version.properties)
  4. execute docker-java-version-shell-daily job immediately
    Enter "please release" in your reply to your commit in gerrit.
  5. confirm docker file in nexus3.onap.org
    Open https://nexus3.onap.org and input your image name in the "Search components" text box. ref the following:
    Image Added