Skip to content

Docker Workflow for DTaaS

This document describes the building and use of different Docker files for development and installation of the DTaaS platform.

NOTE: A local Docker CE installation is a prerequisite for using Docker workflows.

Run

Follow the instructions in developer/README.md to spawn a localhost development instance of DTaaS. It is an end-to-end testing of the current codebase as it exists in the local git directory.

CI Dockerfile Validation

Each pull request that modifies client/**, servers/lib/**, or the relevant Dockerfiles triggers an automated Docker build check. The check uses the reusable workflow .github/workflows/docker-build.yml and runs in parallel with the existing test jobs to avoid increasing build time.

Workflow Dockerfile validated Notes
.github/workflows/client.yml developer/client.dockerfile Full multi-stage build inside Docker
.github/workflows/client.yml developer/client.built.dockerfile Validates the publish image Dockerfile
.github/workflows/lib-ms.yml developer/libms.dockerfile Full multi-stage build inside Docker

The Docker build checks run on pull requests and also on pushes when .github/workflows/client.yml or .github/workflows/lib-ms.yml is triggered by changes to the source code directories (client/** or servers/lib/**).

On pushes to feature/* or release-v* branches, the publish jobs are triggered by changes to the source code directories (client/**, servers/lib/**) to avoid inadvertently re-publishing an already published package version when only a Dockerfile is updated.

Publish Docker Images

Build and publish the docker images. This step is required only for the publication of images to Docker Hub.

🛑 This publishing step is managed only by project maintainers. Regular developers can skip this step.

The DTaaS development team publishes reusable packages which are then put together to form the complete DTaaS application.

The packages are published on github, npmjs, and docker hub repositories.

The packages on github are published more frequently but are not user tested. The packages on npmjs and docker hub are published at least once per release. The regular users are encouraged to use the packages from npm and docker.

A brief explanation of the packages is given below.

Package Name Description Availability
dtaas-web React web application docker hub and github
libms Library microservice npmjs and github
docker hub and github
runner REST API wrapper for multiple scripts/programs npmjs and github

React Website

1
2
3
4
docker build -t intocps/dtaas-web:latest -f ./developer/client.built.dockerfile .
docker tag intocps/dtaas-web:latest intocps/dtaas-web:<version>
docker push intocps/dtaas-web:latest
docker push intocps/dtaas-web:<version>

To tag version 0.3.1 for example, use

docker tag intocps/dtaas-web:latest intocps/dtaas-web:0.3.1

To test the react website container on localhost, please use

1
2
3
docker run -d \
  -v ${PWD}/client/config/local.js:/dtaas/client/build/env.js \
  -p 4000:4000 intocps/dtaas-web:latest

Library Microservice

The Dockerfile of library microservice has VERSION argument. This argument helps pick the right package version from http://npmjs.com.

1
2
3
4
5
6
docker login -u <username> -p <password>
docker build -t intocps/libms:latest -f ./developer/libms.npm.dockerfile .
docker push intocps/libms:latest
docker build --build-arg="VERSION=<version>" \
  -t intocps/libms:<version> -f ./developer/libms.npm.dockerfile .
docker push intocps/libms:<version>

To tag version 0.3.1 for example, use

docker build --build-arg="VERSION=0.3.1" \
  -t intocps/libms:0.3.1 -f ./developer/libms.npm.dockerfile .

To test the library microservice on localhost, please use

docker run -d -v ${PWD}/files:/dtaas/libms/files \
  -p 4001:4001 intocps/libms:latest