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

port_map doesn't work #472

Closed
ChrisMcKenzie opened this issue Nov 19, 2015 · 5 comments
Closed

port_map doesn't work #472

ChrisMcKenzie opened this issue Nov 19, 2015 · 5 comments

Comments

@ChrisMcKenzie
Copy link

I maybe misunderstanding but when I configure the port_map section of task.config it should take the ports given in that map and use them as the port the port that I am listening on in my container and map it to the port that was randomly selected on the host. If this correct it does not appear to be doing that it expose the port from the map but it is not mapped to the host ports

docker reports the following ports

Note: this is happening with even the example.nomad generated by running nomad init

@cbednarski
Copy link
Contributor

Thanks for the report. Can you show me the task config you're using?

There was a similar PR merged this morning to fix the wrong port being exposed but it looked like port_map was working correctly here. #466

@cbednarski cbednarski added this to the v0.2.1 milestone Nov 19, 2015
@ChrisMcKenzie
Copy link
Author

I think that #466 is exactly what I am experiencing.

for what its worth I have been trying a few different task but I was unable to even get this example.nomad to work I get the same looking port map as in #466

task "redis" {
  # Use Docker to run the task.
  driver = "docker"

  # Configure Docker driver with the image
  config {
    image = "redis:latest"
    port_map {
      db = 6379
    }
  }

  service {
    # name = redis
    tags = ["global", "cache"]
    port = "db"
    check {
      name = "alive"
      type = "tcp"
      interval = "10s"
      timeout = "2s"
    }
  }

  # We must specify the resources required for
  # this task to ensure it runs on a machine with
  # enough capacity.
  resources {
    cpu = 500 # 500 Mhz
    memory = 256 # 256MB
    network {
      mbits = 10
      port "db" {
      }
    }
  }
}

@diptanu
Copy link
Contributor

diptanu commented Nov 19, 2015

@ChrisMcKenzie This is already fixed in master, we will release a binary of 0.2.1 this Friday, in the meantime let us know if you see any other issues.

@diptanu diptanu closed this as completed Nov 19, 2015
@ChrisMcKenzie
Copy link
Author

Thanks so much!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants