Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to retrieve the port when listener is separately declared #7135

Open
anupama-pathirage opened this issue Sep 15, 2022 · 0 comments
Open

Comments

@anupama-pathirage
Copy link
Contributor

Description:

When the http:Listner is declared separately the port is not taken.

Steps to reproduce:

  1. Create a project with following sample code.
import ballerina/http;

listener http:Listener httpLis = new http:Listener(9090);

service / on httpLis {
    // This function responds with `string` value `Hello, World!` to HTTP GET requests.
    resource function get greeting() returns string {
        return "Hello, World!";
    }
}
  1. Run the following command

bal build --cloud=docker

  1. You can see the warning WARNING [main.bal:(6:14,6:21)] failed to retrieve port in the console and the generated Dockerfile doesn't contain the port.
Compiling source
        anupama/dockertest:0.1.0
WARNING [main.bal:(6:14,6:21)] failed to retrieve port

Generating executable

Generating artifacts...

        @kubernetes:Docker                       - complete 2/2 

        Execute the below command to run the generated Docker image: 
        docker run -d dockertest:latest

        target/bin/dockertest.jar

Affected Versions:

OS, DB, other environment details and versions:

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

@anupama-pathirage anupama-pathirage transferred this issue from ballerina-platform/module-ballerina-c2c Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant