How to add/replace the module in Vagrant box (Docker image from Docker Hub)

How to add/replace the module in Vagrant box (Docker image from Docker Hub)

Step-by-step guide

This instruction is based on modifications made for mod-notes module and pre-built testing-backend Vagrant box

  1. Update the raml file

  2. Build the project

    mvn clean install
  3. Update the code of the module to match the changes in raml file

 

  1. Build the Docker image inside of the module 

    docker build -t <name> <path> where <path> - location of *-fat.jar file and Dockerfile
  2. Check local Docker images

    docker images
  3. Create an account in the Docker hub and then login in 

    docker login
  4. Publish the image with following command

    docker push username/repository:tag

    After successful push you will be able to see following

  5. Run Vagrant box

    vagrant up vagrant ssh
  6.  Navigate to Vagrant shared folder and pull Docker image

    cd /vagrant/.vagrant docker pull <user_name>/<repository> Example: docker pull b3946935/d_notes
  7. Find the Container Id of the module you want to replace

  8. Stop the Docker container

    docker stop <container_id>

 

  1. Publish the Module descriptor

    http://localhost:9130/_/proxy/modules
  2. Publish Deployments descriptor

    http://localhost:9130/_/discovery/modules
  3. Enable the module for the tenant

    http://localhost:9130/_/proxy/tenants/diku/modules
  4. Check the work of the new endpoint

 

Related articles