-
Notifications
You must be signed in to change notification settings - Fork 0
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
Consider not mounting docker.sock on each container #11
Comments
See this original post on https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ In particular this project looks promising: |
I made some progress on this. Sysbox is very promising. I have successfully run nested containers completely encapsulated from other containers. How I got it working now is that However, once inside a sysbox runtime container you won't be able to nest more sysbox runtime containers. If you need more nested containers, mounting Here's an example of what the nested container layers would look like:
After # 2, you'll no longer able to run any more containers with the sysbox runtime. So any container spawned from # 2, will share the same This should solve the problem of jobs being aware of each other. The only limitation is if a job for some reason also needed nested containers to be unaware of each other and that wouldn't be supported. However, I see that being very unlikely for now. |
The next issue was getting the sysbox runtime working in AWS. I have yet to find an AMI which has the The server didn't support Now everything seems to be working as expected. A slightly cleaner solution is outlined in this comment in the sysbox discussion: nestybox/sysbox/discussions/121#discussioncomment-130136. |
Closed with 04165c8 and ad9b2fb. There is a lot of other follow up with that needed to be done as well such starting See also this follow up issue for installing |
This was always a security issue but is now more urgent/required due to secrets being introduced with the completion of #10. Here is some relevant information:
The benefit of mounting
docker.sock
is strong easy of use. This allows for users to run docker commands within their containers which is a completely valid use case. I personally am using it often to build and push application images from project build containers.Not mounting the
docker.sock
would mean some substantial work would have to be done to not lose the ability to do docker related tasks. The work needed for this should be discussed in a separate issue. However, to summarize some ideas here:docker-build-push
image). This could work by building your application as normal, putting the artifact on a shared volume, then mounting that volume onto the whitelisted image and it would do the necessary docker operations. Another, possibly less versatile, option would be to publish your built artifact and then download it during your docker build.Whatever the implementation, great care needs to be taken so that the docker operations will at least not be able to access the secrets volumes.
This should be a configuration option rather than something hard-coded. If users completely trust all jobs running on the server then it's fine to allow it.
The text was updated successfully, but these errors were encountered: