/module-ballerina-docker

Primary LanguageJavaApache License 2.0Apache-2.0

Ballerina Docker Extension

Annotation based docker extension implementation for ballerina.

Daily build Build Trivy Scan codecov License

Features:

  • Dockerfile generation.
  • Docker image generation.
  • Docker based ballerina debug support.
  • Copy file support.

How to run

Prerequisites

  1. Download and install JDK 17
  2. Get a clone or download the source from this repository.
  3. Export github personal access token & user name as environment variables.
        export packagePAT=<Token>
        export packageUser=<username>
  4. (optional) Specify the Java home path for JDK 17 ie;
        export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-17.jdk/Contents/Home/
  5. (optional) Ensure Docker daemon is running (used for building tests).

Building

  1. Run the corresponding Gradle command from within the module-ballerina-docker directory.
#To build the module:
./gradlew clean build

#To build the module without the tests:
./gradlew clean build -x test
  1. Copy docker-extension/build/docker-generator-***.jar file to <BALLERINA_HOME>/bre/lib directory.

Enable building for Windows Platform

Use the "BAL_DOCKER_WINDOWS=true" environment variable to enable building docker images supporting Windows platform.

Enabling debug logs

Use the "BAL_DOCKER_DEBUG=true" environment variable to enable docker related debug logs when building the ballerina source file.