-2

I am using ec2-instance. installed docker and running rundeck in a container.

How can i expose 4440 port to local ec2 ip address ? i.e, htttp://ec-2ip:4440 should show me rundeck dashboard.

Makyen
  • 31,849
  • 12
  • 86
  • 121
sai
  • 430
  • 1
  • 3
  • 15
  • 1
    I think this question is just a little bit too basic. Have you read any documentation on Docker at all? – Marakai Apr 25 '16 at 23:12
  • Possible duplicate of [How can I forward localhost port on my container to localhost on my host?](http://stackoverflow.com/questions/30109037/how-can-i-forward-localhost-port-on-my-container-to-localhost-on-my-host) – Alex Huszagh Apr 26 '16 at 00:43
  • Please do not vandalize your post. By posting on the Stack Exchange network, you've granted a non- revocable right for Stack Exchange to distribute that content – GBlodgett Nov 04 '18 at 02:20
  • 1
    Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the [CC BY-SA 3.0 license](//creativecommons.org/licenses/by-sa/3.0), for SE to distribute that content (i.e. regardless of your future choices). By SE policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: [How does deleting work? ...](https://meta.stackexchange.com/q/5221/271271) – Makyen Nov 04 '18 at 02:25

1 Answers1

1

You can do something like this.
docker run -it -p 4440:4440 rundeck

-p does the job here. You are publishing the container port on the host. The mapping is -p host_port:container_port

Refer this articles for more options.

https://docs.docker.com/engine/userguide/networking/default_network/binding/ https://github.com/wsargent/docker-cheat-sheet#exposing-ports

uday
  • 142
  • 2
  • 12