Giter Club home page Giter Club logo

module-ballerina-docker's Introduction

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.

module-ballerina-docker's People

Contributors

anupama-pathirage avatar anuruddhal avatar azinneera avatar ballerina-bot avatar chiransachintha avatar gabilang avatar gayaldassanayake avatar hemikak avatar hevayo avatar inzamam-iqbal avatar keizer619 avatar kishanthan avatar lafernando avatar lakwarus avatar maheshika avatar manuranga avatar manuri avatar mattclegg avatar nipunaranasinghe avatar niveathika avatar praneesha avatar pubudu91 avatar suganyasuven avatar tharindu-nw avatar thisaruguruge avatar udda1996 avatar uthaiyashankar avatar vinok88 avatar warunalakshitha avatar xlight05 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

module-ballerina-docker's Issues

Docker annotation should support missing Dockerfile instructions

Description:
We should support adding following instructions via annotation.

  • ENV
  • STOPSIGNAL
  • HEALTHCHECK
  • MAINTAINER

Suggested Labels: Improvement

Suggested Assignees:

Affected Product Version: 1.1.0

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Docker container command fails to run

Description:
Following the quick tour in the ballerina site, I created a service and then tried to build a docker image out of it and run a container. But the container failed. Here are some

Suggested Labels:
bug

Affected Product Version: Ballerina version 0.982.0

OS, DB, other environment details and versions: macOS High Sierra 10.13.6

Steps to reproduce:

  1. Clone this repo -
  2. Run these commands :
$ ballerina pull wso2/twitter
$ ballerina build hello_service.bal
$ docker run -d -p 9090:9090 registry.hub.docker.com/karuppiah7890/ballerina_hello_world:v0.0.1

And you should be able to see the issue using these commands :

$ docker ps -a

I tried to debug it. Here are some commands that I ran and their outputs :

$ docker run -d -p 9090:9090 registry.hub.docker.com/karuppiah7890/ballerina_hello_world:v0.0.1

58fd80f6a7b1e7c5b0a9a0e72976da2881f3c4a3f4e88f91da5f7de967baf5ea

$ docker ps -a

CONTAINER ID        IMAGE                                                                COMMAND                  CREATED             STATUS                     PORTS               NAMES
58fd80f6a7b1        registry.hub.docker.com/karuppiah7890/ballerina_hello_world:v0.0.1   "/bin/sh -c 'balleri…"   6 seconds ago       Exited (1) 4 seconds ago                       gallant_raman

$ docker logs gallant_raman

ballerina: too many arguments
Run 'ballerina help' for usage.

$ docker inspect gallant_raman

[
    {
        "Id": "58fd80f6a7b1e7c5b0a9a0e72976da2881f3c4a3f4e88f91da5f7de967baf5ea",
        "Created": "2018-10-12T15:35:29.513454801Z",
        "Path": "/bin/sh",
        "Args": [
            "-c",
            "ballerina run hello_service.balx --config ./home/ballerina/conf/twitter.toml"
        ],
        "State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 1,
            "Error": "",
            "StartedAt": "2018-10-12T15:35:30.026623391Z",
            "FinishedAt": "2018-10-12T15:35:30.9931953Z"
        },
        "Image": "sha256:48cd86928a3c8bf766008f5644a38914cef9d9483b59e71c2d1a934909418e1c",
        "ResolvConfPath": "/var/lib/docker/containers/58fd80f6a7b1e7c5b0a9a0e72976da2881f3c4a3f4e88f91da5f7de967baf5ea/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/58fd80f6a7b1e7c5b0a9a0e72976da2881f3c4a3f4e88f91da5f7de967baf5ea/hostname",
        "HostsPath": "/var/lib/docker/containers/58fd80f6a7b1e7c5b0a9a0e72976da2881f3c4a3f4e88f91da5f7de967baf5ea/hosts",
        "LogPath": "/var/lib/docker/containers/58fd80f6a7b1e7c5b0a9a0e72976da2881f3c4a3f4e88f91da5f7de967baf5ea/58fd80f6a7b1e7c5b0a9a0e72976da2881f3c4a3f4e88f91da5f7de967baf5ea-json.log",
        "Name": "/gallant_raman",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {
                "9090/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "9090"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "shareable",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/asound",
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/899b0e1cfa79604c16081aed4ebb76430ebd487b35bb5efd17cb93d692f6373f-init/diff:/var/lib/docker/overlay2/eb6f7c9e96c7fcebd8aa7418b95682d47fdcf733fef06f6927fa2cfe8e637ba9/diff:/var/lib/docker/overlay2/8dc78f13764fde40535934a0d99520005c43ab02071e1616918ea77d33192335/diff:/var/lib/docker/overlay2/164bd1c0b5bc81c5627e2cbbbd160a0d7c7b5f9949b37e81efb1479b6775c67a/diff:/var/lib/docker/overlay2/11e7b8addf43140501e96f1a19a709c304a3e08d8cf6e85fc89a8f3ecbe1ac34/diff:/var/lib/docker/overlay2/a4adcca86082a8cc853e0f89d89053cd7794b69446277fc1eab9bab9cae0d152/diff:/var/lib/docker/overlay2/c42885338a4ad692433bb86934ffe98cd2e96b51640b47d78c425bfef416e2fb/diff",
                "MergedDir": "/var/lib/docker/overlay2/899b0e1cfa79604c16081aed4ebb76430ebd487b35bb5efd17cb93d692f6373f/merged",
                "UpperDir": "/var/lib/docker/overlay2/899b0e1cfa79604c16081aed4ebb76430ebd487b35bb5efd17cb93d692f6373f/diff",
                "WorkDir": "/var/lib/docker/overlay2/899b0e1cfa79604c16081aed4ebb76430ebd487b35bb5efd17cb93d692f6373f/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "volume",
                "Name": "543d25809a7d7e0140981f637771d3d12836f968da77493cd44295179ab8bd99",
                "Source": "/var/lib/docker/volumes/543d25809a7d7e0140981f637771d3d12836f968da77493cd44295179ab8bd99/_data",
                "Destination": "/home/ballerina",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "58fd80f6a7b1",
            "Domainname": "",
            "User": "ballerina",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "9090/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/ballerina/runtime/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin",
                "LANG=C.UTF-8",
                "JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/jre",
                "JAVA_VERSION=8u151",
                "JAVA_ALPINE_VERSION=8.151.12-r0",
                "BALLERINA_HOME=/ballerina/runtime"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "ballerina run hello_service.balx --config ./home/ballerina/conf/twitter.toml"
            ],
            "ArgsEscaped": true,
            "Image": "registry.hub.docker.com/karuppiah7890/ballerina_hello_world:v0.0.1",
            "Volumes": {
                "/home/ballerina": {}
            },
            "WorkingDir": "/home/ballerina",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {
                "maintainer": "[email protected]"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "725f494ba01fc91dd3588a915e9e41ae07da43651e58dec6b9779d622a3ff86e",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/725f494ba01f",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "0037a2c4984c8d8d56e8fe2607014d39c41728d233793affdad4903b6f837d80",
                    "EndpointID": "",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }
    }
]

Looking at all this, I feel that the args is wrong in the start command of the container - basically the ballerina run command is wrong.

        "Args": [
            "-c",
            "ballerina run hello_service.balx --config ./home/ballerina/conf/twitter.toml"
        ],

The --config flag and it's values should come before the hello_service.balx file, from what I see in ballerina help run. @anuruddhal can you please check this and confirm ? If this is the bug, I can raise a PR πŸ˜„ I might need some help with the tests though

Show docker build command when buildImage is set to false.

Description:
Currently the docker run command is shown on the console when ballerina build ... is executed. This is because buildImage field is true by default. But then buildImage field is set to false, the docker build ... command is not shown. This needs to be shown as a way of guiding the developer.

Add copy directory support to Docker extenstion

Description:
At the moment only files can be specified with @docker:CopyFiles{} annotation. We should add support to copy a directory and it's subdirectories & files to docker image.

Suggested Labels:
Enhancement

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Docker image based on Windows Platform

Description:
As of now the docker image provided by ballerina is a linux based docker image. Users who use windows needs to do several changes to their OSs in order to get it worked with linux based platforms.

Introduce @docker:CMD

Hi All,

We are using the following command in generated Dockerfile and docker images.

CMD java -jar hello.jar --b7a.config.file=${CONFIG_FILE}

I would like to propose a new annotation @docker:CMD that allowed the user to alter the default CMD line. Some cases use have to use custom CMD, eg write logs to deferent mount paths rather writing to console out.

eg. @docker:CMD("CMD java -jar ${APP} --b7a.config.file=${CONFIG_FILE} > /var/log/ballerina.log 2>&1")

For the moment this can't be done unless manually edit the Dockerfile and regenerate the image. This is an optional annotation and this will work handy in several use-cases.

Need to create a separate user for running java -jar in generated Dockerfile

Description:
The currently generated Dockerfile executes java -jar as root. Need to have a separate user set in for executing java -jar.

Affected Product Version:
1.0.2, 1.0.2

OS, DB, other environment details and versions:

Steps to reproduce:
You can verify that with the following command run inside the created container.

/home/ballerina # id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
/home/ballerina # whoami
root

Add support for pushing docker images to private registries

Description:

  • Add support for pushing docker images to private registries via tokens and config.json.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Wrong argument order to ballerina command

Description:
In generated Docker file, order of arguments to ballerina command is wrong.

Currently generated Docker CMD
CMD ballerina run hello_service.balx --config /home/ballerina/conf/twitter.toml

This should be (in 0.982.0)
CMD ballerina run --config /home/ballerina/conf/twitter.toml hello_service.balx

Affected Product Version:
0.982

Steps to reproduce:
Follow docker section of Ballerina quick-tour.

Copy key-store and trust-store automatically to Docker Images

Description:
At the moment Keystore and trust store has to be copiede to Docker images using @copyFiles annotation. Instead, these can be automatically copied to the Docker image by creating the same path as in the source file.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Support getting docker registry credentials via docker auth string

We support automated docker push. Docker registry credentials are getting like bellow

@docker:configuration {
push:true,
registry:"index.docker.io/username",
name:"helloworld-push",
tag:"v2.0.0",
username:"username",
password:"password"
}

Addition to above, I am proposing following option

  • docker auth string

Propose annotation
@docker:configuration {
push:true,
registry:"index.docker.io/username",
name:"helloworld-push",
tag:"v2.0.0",
dockerAuth:"auth string"
}

auth string can be find in ~/.docker/.dockercfg or ~/.docker/config.json

Ballerina-Platform Container - Build Not Building Docker Image

Description:
Working on CI/CD flow with ballerina and currently trying to build via the docker container.
Example:
docker run -v $(pwd):/home/ballerina --rm ballerina/ballerina-platform:0.981.1 ballerina build sims.bal

sims.bal builds fine when running via mac ballerina build.

When running via docker container I get the following output:

docker run -v $(pwd):/home/ballerina --rm ballerina/ballerina-platform:0.981.1 ballerina build sims.bal
Compiling source
    sims.bal

Generating executable
    sims.balx
        @kubernetes:Service                      - complete 1/1
        @kubernetes:Ingress                      - complete 1/1
        @kubernetes:ConfigMap                    - complete 1/1
        @kubernetes:Deployment                   - complete 1/1
error [k8s plugin]: package [.] Unable to build Docker image: No such file or directory

If I'm missing something, please let me know! :)

Suggested Labels:

Suggested Assignees:

Affected Product Version:
Docker Image: ballerina/ballerina-platform:0.981.1

OS, DB, other environment details and versions:
Localhost: Darwin

Steps to reproduce:

Related Issues:

Should @docker:CopyFiles copy the files to the created docker/ directory?

Description:
$title?

Currently, whatever the files specified in the annotation seem to be copied to the docker directory created.

$ tree
.
β”œβ”€β”€ abc.bal
β”œβ”€β”€ abc.jar
β”œβ”€β”€ docker
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ foo.txt
β”‚   └── qwe.conf
β”œβ”€β”€ foo.txt
└── qwe.conf

1 directory, 7 files

Is this intended?

CheckStyle Issue in https://github.com/ballerinax/docker/blob/master/docker-extension/src/main/java/org/ballerinax/docker/utils/DockerGenUtils.java#L44

Description:
Getting Issue while installing Ballerina docker image.
https://github.com/ballerinax/docker/blob/master/docker-extension/src/main/java/org/ballerinax/docker/utils/DockerGenUtils.java#L44

Suggested Labels:
Ballerina docker

Suggested Assignees:

Affected Product Version:
Current
OS, DB, other environment details and versions:

Steps to reproduce:
install ballerina docker image
Logs.txt

Related Issues:

Possibly apply docker config to endpoint as well as service?

Description:
When I put my docker annotation at the top of my .bal file, I often get an error because the first code block is an endpoint. Since the docker annotation really applies to the .bal, maybe we could allow binding to both services and endpoints.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Support remote docker host

Current we are connecting to docker daemon by using /var/run/docker.sock. This is work if we install docker in local machine or if you used docker for mac.

If we want to use remote docker host to create docker images, we should allow to connect. Example if we use minikube we need to connect via socket.

Propose annotation to support this
@docker:configuration{dockerHost:tcp://IP:PORT} .
Default value should be tcp://127.0.0.1:2375

Fix docker error during ballerina build.

Description:
ballerina build [module-name] returns an error:

error [docker plugin]: module [ballerinaplayground/playground:0.1.0] unable to connect to server:   org.apache.http.client.ClientProtocolException

Affected Product Version:
Ballerina 1.0.4
OS, DB, other environment details and versions:
Windows 10, Docker Desktop 2.1.0.5

Steps to reproduce:

  • Create a project with modules and add docker to it:
@docker:Expose {}
listener http:Listener listenerName = new(9090);

@docker:Config { name: "dockerName", tag: "v1.0", dockerHost: "localhost"}  // Expose Docker daemon to localhost for this to work
service serviceName on listenerName {
  • Run ballerina build [module-name]

Note: If docker is used for a single file (Ballerina build file.bal) everything works fine

Allow Docker API Version To Be Set in The Docker Client

In the HTTP calls that are done by Docker clients to the Docker daemon, we can optionally set the Docker API version with the requests. This is sometimes required, to make sure we bind our actions with a specific API version. Also, some Docker daemon implementations require users to set the API version, e.g. GitHub Actions.

So due to this, we need to way to provide the Docker API version to be used by the client. I suggest using an environment variable to set it, when the Ballerina build is happening. The environment variable for this can be "DOCKER_API_VERSION".

Support main programs with Docker

Description:
Docker should support main as well as service
For example it would be nice to package a TimerTask as a docker container.

Suggested Labels:
Improvement

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

dockerHost annotation is not working

Tested with minikube

lakmals-mbp:sample1 lakmal$ minikube docker-env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/lakmal/.minikube/certs"
export DOCKER_API_VERSION="1.23"

Run this command to configure your shell:

@docker:configuration{dockerHost:"tcp://192.168.99.100:2376"}

error :
error [docker plugin]: error building docker image: Connection reset
ballerina: error writing program file 'hello_world_docker.balx'

@docker:Config CMD is not working

Tested version: jBallerina 1.1.4
annotation:

@docker:CopyFiles {
files: [
{ sourceFile: "/tmp/secret.txt", target: "/tmp/secret.txt"}
]
}
@docker:Config {
cmd: "java -jar ${APP} --b7a.config.secret=/tmp/secret.txt"
}

Issue:
Generated Dockerfile

Auto Generated Dockerfile

FROM ballerina/jre8:v1

LABEL maintainer="[email protected]"

RUN addgroup troupe
&& adduser -S -s /bin/bash -g 'ballerina' -G troupe -D ballerina
&& apk add --update --no-cache bash
&& chown -R ballerina:troupe /usr/bin/java
&& rm -rf /var/cache/apk/*

WORKDIR /home/ballerina

COPY sample.jar /home/ballerina
COPY secret.txt /tmp/secret.txt

EXPOSE 8080
USER ballerina

java -jar sample.jar --b7a.config.secret=/tmp/secret.txt

Missing "CMD " in the last line of the generated Dockerfile. Due to this docker build is not working and ballerina build is hanged

When building a docker annotations added ballerina project with tests, unless the docker base image is specified, the built container wouldn't start

Description:
$subject

Config that works

@docker:Config {
    registry: "ballerina.guides.io",
    name: "employee_database_service",
   tag: "v1.0",
    baseImage: "ballerina/ballerina-platform:0.980.0"
}

Config that causes the issue

@docker:Config {
    registry: "ballerina.guides.io",
    name: "employee_database_service",
   tag: "v1.0"
}

Container would start and exit immediately. When checking the logs in the container following can be seen.

docker logs 476dd1f0a7c3
error while reading package: ballerina/test

Execute tests in windows platform

Description:
As of now the tests written are not getting executed in travis's windows build. This is blocked because the docker client could not be configured to travis's docker API.

NPE when running ballerina build without docker

Description:
When running the ballerina build command while the docker is not running following output is printed.

It is an NPE and the ballerina-internal.log is also created. This is not a situation where we should create the ballerina-internal.log file.

[2018-06-19 14:56:55,448] ERROR {org.ballerinalang.launcher.Main} - null
java.lang.NullPointerException
	at org.ballerinax.kubernetes.DockerPlugin.codeGenerated(DockerPlugin.java:159)
	at org.wso2.ballerinalang.compiler.BinaryFileWriter.lambda$writeExecutableBinary$390(BinaryFileWriter.java:118)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at org.wso2.ballerinalang.compiler.BinaryFileWriter.writeExecutableBinary(BinaryFileWriter.java:117)
	at org.wso2.ballerinalang.compiler.BinaryFileWriter.write(BinaryFileWriter.java:89)
	at org.wso2.ballerinalang.compiler.Compiler.build(Compiler.java:86)
	at org.ballerinalang.packerina.BuilderUtils.compileAndWrite(BuilderUtils.java:54)
	at org.ballerinalang.packerina.cmd.BuildCommand.execute(BuildCommand.java:91)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.ballerinalang.launcher.Main.main(Main.java:66)

Suggested Labels:
Bug

Suggested Assignees:

Affected Product Version:
0.975.0

OS, DB, other environment details and versions:
Mac OS

Steps to reproduce:

  • Compile a ballerina program with docker annotations without starting docker deamon.

Related Issues:

Add support to create docker images from thin jar

Description:

  • Add support to create docker images from the thin jar instead of uber jar.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

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.