product-microgateway
product-microgateway copied to clipboard
Not able to create docker image with debug enable
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 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.
- Open
<TOOLKIT_HOME>/resources/templates/dockerConfig.mustache
. - Update line 10 and 11 with bellow diff
- 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}},
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
https://github.com/wso2/product-microgateway/pull/1224 fixes the issue partially