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.