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

Socket activated docker #8

Closed
pierreozoux opened this issue Sep 4, 2014 · 9 comments
Closed

Socket activated docker #8

pierreozoux opened this issue Sep 4, 2014 · 9 comments

Comments

@pierreozoux
Copy link

Anybody has an idea about that

Basically the use case is really simple: I have an nginx in a container, and I want to start it on incoming connection on port 80.
I think this is possible, but I didn't see anything nor anybody saying they did it with Docker.
If you have anything, please let me know :)

@daviddias
Copy link
Member

@apocas ^^

@apocas
Copy link
Member

apocas commented Sep 4, 2014

If you don't mind to write a bit of code and have something running:
A very small nodejs script with dockerode would to this easily :-D (probably 20 lines)

If you don't want to write code:
Well if you want to listen for an incoming connection, you have to be listening for it.
Since the container is yet to be started, there needs to be something listening for this connection outside that container:

nc.traditional -v -l -p 80 -c "docker start ..."
(this is very hackish but it should work, nc.traditional is netcat non bsd version in ubuntu)

@pierreozoux
Copy link
Author

I think I can do it with systemd :) (I don't want to solve by hand a problem that would impact security of the whole system)

@apocas
Copy link
Member

apocas commented Sep 17, 2014

If you want to go that way you must read this: http://0pointer.net/blog/projects/socket-activation.html
(just read it on HN and instantly remembered Pierre)

@pierreozoux
Copy link
Author

Already read it last week, thanks! I think in the mean time, I'll go with systemd-socket-proxyd.

It's a little bin that actually gives socket activation to any socket capable bin. I have to try it thought, but looks like a good candidate.

It's made by the guy that answered the thread on SO. This guy commits to systemd, and help writing this post about containers and socket activation. He also did this presentation in a docker hack day.

@davidstrauss
Copy link

Hi, I'm the author of socket-proxyd. Please let me know if you have any questions.

@pierreozoux
Copy link
Author

Thanks, I think I'll wait for rkt/rkt#106 to close and switch to rocket.
What is your idea on that?

The thing is that, I'm already using https://github.com/ibuildthecloud/systemd-docker, so if I add socket-proxyd, it will not just be smelly, it will stink :)

I think if it is solved at the container manager level, and if this container manager integrates well with systemd, then it is nice!

@davidstrauss
Copy link

What is your idea on that?

Sounds good to me. Just offering my expertise because it's an area of systemd that only a few people understand well.

@pierreozoux
Copy link
Author

Thanks for your input, I'll close this issue.
I have to switch to kubernetes before rkt :) But the issue is merged now on rkt code base.

I'm wondering about systemd-nspawn and runC though.

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

4 participants