I've a commercial app, that is shipped in a chroot environment : the startup script is making the chroot, and starting the exe.

The App is pretty complex, and also for support purposes, I don't want to change the all environment.

Is it possible to run chroot, and start the service in docker ? Or are the two incompatible ?

share|improve this question
    
Should be fine. Why not try it and ask a specific question if you have problems? – Adrian Mouat Oct 20 '15 at 11:46
up vote 2 down vote accepted

It is possible to make a chroot inside a container... but, as mentioned in "debootstrap inside a docker container", you might need to run with the privileged mode.

docker run --privileged

By default, Docker containers are “unprivileged” and cannot, for example, run a Docker daemon inside a Docker container.
This is because by default a container is not allowed to access any devices, but a “privileged” container is given access to all devices.

There was a huge discussion for requesting docker to support privileged operations.
So far, it is not happening.

share|improve this answer
    
How would you incorporate this in a supervisor configuration ? : - I need to make the chroot, - Then start 3 skripts – OpenStove Oct 22 '15 at 12:34
    
@OpenStove Have a look at github.com/phusion/baseimage-docker which is using a supervisor-like mechanism (I described it in stackoverflow.com/a/33119321/6309). You would still need to run the container in privieged mode though. – VonC Oct 22 '15 at 12:41

As stated above, in order to use chroot in Docker you will need to have elevated privileges. What you could do though instead of using chroot directly is use a program called Coffer. Coffer is essentially a neat wrapper around chroot that takes care of all the heavy lifting for you.

https://github.com/Max00355/Coffer

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.