#Ballerina docker build fails.

1 messages · Page 1 of 1 (latest)

dusk harbor
#

Hi I'm creating a REST API on ballerina 2201.1.2. The service is running without any issue with bal run command and also no any errors in bal build command.

But when trying to build the docker image using bal build --cloud=docker following error occurs and build fails.

error: compilation failed: The compiler extension in package 'ballerina:cloud :2.2.1' failed to complete. class io.ballerina.compiler.syntax.tree.QualifiedNameReferenceNode cannot be cast to class io.ballerina.compiler.syntax.tree.BasicLiteralNode (io.ballerina.compiler.syntax.tree.QualifiedNameReferenceNode and io.ballerina.compiler.syntax.tree.BasicLiteralNode are in unnamed module of loader 'app')

How can I resolve this?

dusk harbor
#

Was able to fix this by changing the following code

service / on new http:Listener(config:PORT)

to

listener http:Listener ep0 = new (config:PORT);

service / on ep0 {
hazy gust
#

@drowsy quail

drowsy quail
#

The compilation failure is from ballerina:cloud compiler. @void hedge can you check this

void hedge
#

This is due to a bug and a limitation in code to cloud extension.
Even after you change the code, did u have the port exposed in the dockerfile?