-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Docker support #52
Comments
That's unfortunately not possible to do as it would require running the workspace containers in privileged mode. But we should have a command line util that allows to build and run docker images externally as a service. |
Any news about this command line util ? |
@dimensi0n we haven't looked at implementing this yet, but now I'm thinking that maybe we could somehow interface a local Maybe this could also somehow be a way to improve Gitpod's repository setup automation workflow (where currently I need to commit a Dockerfile, push it to a branch, manually create a new workspace for that branch, test it, and return to my first workspace to iterate in a relatively tedious way). |
Just spitballing but could you install docker in the default Gitpod image and then add the gitpod user to the docker group? I think that it would allow users to test Dockerfiles from the command line. |
Thanks for the suggestion @JesterOrNot. Unfortunately, I believe that from a security standpoint, adding user However, maybe it's possible to install the |
Heres another idea you know google cloud shell? well there is a vscode extension that allows you to access it remotely it's free and has docker installed in it could we either set it up as a remote client or have the extension pre-installed? |
Here is a repo with the Docker CLI installed in it can someone help me get it hooked up to the gitpod image builder? or maybe just send a PR |
Thanks a lot @JesterOrNot! I'm not sure how to use Gitpod's image-builder API. @32leaves or @geropl do you have any insights here? (We're trying to make image-builder build a Dockerfile, not by committing to a repo and opening it in Gitpod, but by directly sending the Dockerfile to image-builder.) |
Any updates per the status of this issue? |
Hi @JesterOrNot , not much of an update, unfortunately, but more details to share. The challenge here is that the standard docker daemon requires root privileges and in the Gitpod workspaces we don't have root privileges. Things you could do:
USER gitpod
# Rootless Docker
# gets installed to /home/gitpod/bin
RUN curl -sSL https://get.docker.com/rootless | sh
# It requires the following env vars:
ENV XDG_RUNTIME_DIR=/tmp/docker-33333
ENV PATH=/home/gitpod/bin:$PATH
ENV DOCKER_HOST=unix:///tmp/docker-33333/docker.sock Things the Gitpod team can be doing: But we don't have a time plan for this yet, so playing with option (1) and (2) will be well worth it. |
I'll get started with option 2! |
I think the best route to official docker support is likely for us to support other base images because a lot of the "rootless" docker images are not Debian/Ubuntu based. |
Have you considered podman rootless and setting |
@brandonkal I'll take a look. |
@JesterOrNot I just tried using podman and it is broken
gitpod /workspace/pulumi-gitpod/docker $ podman build .
cannot clone: Operation not permitted
Error: could not get runtime: cannot re-exec process I've also tried k3s in rootless mode, which also fails. curl -sfL https://github.com/rancher/k3s/releases/download/v1.0.0/k3s -o k3s
gitpod /workspace/pulumi-gitpod $ chmod +x k3s
gitpod /workspace/pulumi-gitpod $ ./k3s server --rootless
INFO[0000] Preparing data dir /home/gitpod/.rancher/k3s/data/2492a28b74abfbdbd3f943c8109a93e979669647bbbe95eadae43b60c667df69
FATA[2019-12-09T19:56:12.743952707Z] failed to start the child: fork/exec /proc/self/exe: operation not permitted Running k3s inside gitpod would be very cool as it would mean I could easily share a kubernetes reproduction. Some info that may help: And the workspace I have been experimenting in |
@brandonkal AFAIK we need to extend our images from gipod/workspace-full or gipod/workspace-full-vnc |
See docker/for-linux#885 this is probably why rootless docker is not working |
Is gitpod's docker running as root? |
Yes, I believe that's the case in Gitpod's Kubernetes infra. |
@JesterOrNot We tried different tools:
|
To address this issue, without having to do anything hacky, the perfect solution would be the sysbox. If we had this kind of setup in the Kubernetes cluster, we could not only run Docker in Docker without
This means the ability to run Docker in Gitpod, plus also other services with |
So a different container runtime. Looks interesting @felipecassiors but there is no license that I can see. |
It also seems to be brand new, not yet v1, and gives some seccomp permissions to containers that I personally wouldn't feel comfortable with without a thorough security review. |
Any update on this? |
Relevant: docker/compose#7244 (comment) Development of rootless docker |
Need this too! |
Sysbox is now open-source. I believe you should revisit this alternative, as long as your VMs runs an Ubuntu OS newer than 18.04.4 it's able to run the containers with sysbox. |
It's important to note some cloud-oriented build images of Ubuntu 19.04 with older kernels don't have |
I really hope this will be implemented soon. This is a major required feature! It's quite painful currently because when I want to do a build "locally" or experiment with Dockerfiles, I have to checkout the project "really locally", setup stuff etc. and wait a lot (due to slower internet compared to Gitpod's connection). This significantly slows down Docker-built projects. |
When Gitpod supports docker and hopefully docker-compose too, that'd be awesome! |
Unsubscribed due to +1 noise. Please mention if you need to reach me. |
any ETA about this one? |
No ETA yet but I can give you hope that in the not too distant future there will be some news on that topic. |
FYI we're doing a YouTube livestream about this feature in about ~2.5 hours: https://www.youtube.com/watch?v=l4I2TVAnBuw |
This now works in Gitpod's (internal) staging environment, and should be included in Gitpod's next production deployment (as a Beta feature that can be enabled in Settings). We will close this issue when |
+1 |
Successfully deployed and confirmed working in production (as a Beta feature)! 🎉 Here is how to get
Note that this is currently a Beta feature, and it may have a few rough edges (e.g. it may impact workspace start-up times -- if in doubt, you can always disable "Feature Preview" again). If you notice anything strange, please report it: You can add a comment here, or file a new issue, or post feedback in https://community.gitpod.io Enjoy! We're super proud to be able to bring you this highly requested feature, and we hope it will bring you a lot of value and joy. (We personally can't stop using it & finding new use cases for it. 😄) |
Thanks for the hard work. I just tried, it all works :) 👍 |
This is so awesome to have Docker support. Thanks. 👍 Unfortunately I have a problem using Docker with setting up a development Kubernetes cluster for a out of the box Knative development setup. I still run into privilege errors. These are different issues, depending what kind of solution I try. I documented my issues in the community https://community.gitpod.io/t/knative-development-on-gitpod/2814 I'm not sure if this is a topic for here, there or if I should file new issues. |
The default image(s) should include some sort of docker support, so I can run
docker build
, as well asdocker start
to run either my own service (and expose ports as usual) or its requirements.The text was updated successfully, but these errors were encountered: