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

Running applications inside the container #1

Closed
marcellodesales opened this issue Oct 15, 2014 · 7 comments
Closed

Running applications inside the container #1

marcellodesales opened this issue Oct 15, 2014 · 7 comments

Comments

@marcellodesales
Copy link

Hi @gai00

How can I run the applications inside the Docker container??? Since there's only one port open 3131, I can't connect to the application when I do "Run"...

screen shot 2014-10-15 at 12 18 10 pm

The port numbers are randomly assigned by the Cloud9 Editor... Is there a way to set a static port number instead? That way, it would be easier to run it from Docker.

Thanks a lot!

@gai00
Copy link
Owner

gai00 commented Oct 21, 2014

(My english is not good.)
You can set a static port.
var port = [what you want]; //ex: 20080

And run docker with -p 20080:20080 .

@marcellodesales
Copy link
Author

@gai00 Sorry but the Cloud9 Editor starts a process at a random port inside the container... :) At that moment, it is a chicken-egg problem!!! Docker needs to create the port forward before... This does not work...

@gai00
Copy link
Owner

gai00 commented Oct 22, 2014

Try to edit your url when url in console is not working correctly.
I almost open a new tab in browsers(IE/Firefox/Chrome/Safari) to check compatibility.
workspace - cloud9 1

@gai00 gai00 closed this as completed Oct 24, 2014
@marcellodesales
Copy link
Author

That's the whole point of this issue... Your container was assigning a random port to the RUN... This makes things completely complicated...

@gai00
Copy link
Owner

gai00 commented Oct 26, 2014

docker run -p 20080:20080 -p 3131:3131 -p 80:80 layer/cloud9 ...
Just add -p host_port:container_port on running.
I hope this can help you.
http://docs.docker.com/reference/run/#expose-incoming-ports

If you meet the bug about missing session, this may help you.
https://github.com/ajaxorg/cloud9/issues/2005#ref-commit-1681e6c

@gai00 gai00 reopened this Oct 26, 2014
@marcellodesales
Copy link
Author

@gai00, I completely understand how to expose ports... All I am saying is that ports should be random as they are in Cloud9, and NEVER statically chosen...

This is the feature needed to maintain it... All my apps are configured using "env.PORT"...

moby/moby#1834

thanks!

@gai00
Copy link
Owner

gai00 commented Oct 27, 2014

@marcellodesales , We are waiting for new version Cloud9. (maybe long time)
https://github.com/ajaxorg/cloud9/issues/3200

If you want to allow random port, and specific hostname (localhost/127.0.0.1),
add -P to publish all port (docker cmd), and add tail -l hostname (cloud9 cmd, lowercase L).
EX:
docker run ... -P gai00/cloud9 -l 127.0.0.1 ...
https://github.com/ajaxorg/cloud9/#installation-and-usage

My docker file set -l 0.0.0.0 on entrypoint. (Listen to all, using host firewall to block)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants