product-microgateway icon indicating copy to clipboard operation
product-microgateway copied to clipboard

Not able to create docker image with debug enable

Open umerasir opened this issue 4 years ago • 3 comments

Description:

On setting enableDebug = true in deployment-config.toml unable to build and push docker image

deployment-config.toml

[docker] [docker.dockerConfig] enable = true name = "ping-new" registry = 'docker.wso2.com' tag = 'v1' buildImage = true dockerHost = 'localhost' #dockerCertPath = '' baseImage = 'wso2/wso2micro-gw:3.0.1' enableDebug = true debugPort = 5050 #push = ''

[docker.dockerCopyFiles] enable = true [[docker.dockerCopyFiles.files]] source = 'C:/WSO2/Microgateway/3_0_2/conf/micro-gw.conf' target = '/home/ballerina/conf/micro-gw.conf' isBallerinaConf = true

Docker build command:

micro-gw build ping_new --docker --docker-image ping:v1 --docker-base-image wso2/wso2micro-gw:3.1.0 JAVA_HOME: C:\Program Files\Java\jdk1.8.0_221 Generating sources...[DONE]

.................................. There are no new updates available .................................. Compiling source wso2/ping_new:3.1.0 error: wso2/ping_new:3.1.0::listeners.bal:55:17: incompatible types: expected 'boolean', found 'string' error: wso2/ping_new:3.1.0::listeners.bal:56:15: incompatible types: expected 'int', found 'string'

Affected Product Version:

3.1.0

umerasir avatar Apr 06 '20 12:04 umerasir

@umerasir Thanks for reporting the issue.

This seems to be an actual issue in the ballerina code generation we do. We'll push a fix soon for this. As a temporary solution till we do the next patch release, you can update the code generation templates as below.

  1. Open <TOOLKIT_HOME>/resources/templates/dockerConfig.mustache.
  2. Update line 10 and 11 with bellow diff
  3. Save the file and build the project again.
-    enableDebug:"{{containerConfig.docker.dockerConfig.enableDebug}}"{{/if}}{{#if containerConfig.docker.dockerConfig.debugPort}},
-    debugPort:"{{containerConfig.docker.dockerConfig.debugPort}}"{{/if}}{{#if containerConfig.docker.dockerConfig.push}},

+    enableDebug:{{containerConfig.docker.dockerConfig.enableDebug}}{{/if}}{{#if containerConfig.docker.dockerConfig.debugPort}},
+    debugPort:{{containerConfig.docker.dockerConfig.debugPort}}{{/if}}{{#if containerConfig.docker.dockerConfig.push}},

praminda avatar Apr 07 '20 05:04 praminda

thanks, i made above changes. am able to push docker image to registry but when i run the container am not able to connect remote debug port

umerasir avatar Apr 07 '20 09:04 umerasir

https://github.com/wso2/product-microgateway/pull/1224 fixes the issue partially

Rajith90 avatar May 06 '20 08:05 Rajith90