Docker-Compose Support?

Is there any chance GitPod will be adding support for docker-compose?

1 Like

The underlying problem is that we cannot support Docker in our workspaces yet for security reasons. We get quite a lot of requests to support Docker and really would love to make this possible. We are working on some steps in that direction but I can’t promise anything right now.

Once we could provide Docker support, docker-compose support will be available as well. Please stay tuned …

By the way: Supporting Docker in a self-hosted Gitpod instance is rather feasible if you trust your users enough.

1 Like

wait, I thought there already was some docker support?

You’d basically have to modify: https://github.com/gitpod-io/workspace-images/blob/master/full/Dockerfile

and make a multi-stage dockerfile?

The workspace itself runs as Docker container. Therefore you can define your own Dockerfile that will be used to create your workspace container (there are some limitations, e.g. which base OS can be used, etc.). However, once the workspace container is up and running you are not able to run Docker inside the workspace to start another Docker container.

Hope that helps to understand the situation better. Feel free to ask if there is something unclear.

2 Likes

Hey thanks.
That makes sense because its a container inside a container among other issues.
Most of my experience with docker is with compose to configure existing images.
Guess I need to step up my actual docker game…

We get quite a lot of requests to support Docker and really would love to make this possible.

Indeed, I would love to see this feature, but I guess security first! :slight_smile:

2 Likes

Would be great if we could use docker-compose on self-hosted Gitpod :slight_smile:

They said the new feature might be available as beta in the next couple of weeks - Live Session: Rootless Workspaces in Gitpod

3 Likes

Answer here:

3 Likes

Are there any updates on this? I would REALLY love to use gitpod for my projects, but docker support is missing.

@dragonDScript: With Feature Preview enabled you can use docker-compose as well. However, it’s still in a beta phase and some things will not work yet.

Is there any examples of usage for this? I’ve a few projects that I run with docker-compose up would love to see how I could convert these to gitpod

@jmcelreavey: These are the steps:

  • go to https://gitpod.io/settings/ and enable Feature Preview.
  • start a new workspace
  • run sudo docker-up in a Terminal
  • run docker-compose up in another Terminal

That’s it. Be aware that this is still a feature preview. Some things will not work yet. We look forward to hearing about your experiences.

3 Likes

This works well, however, performance is affected a lot.
Anyway, thank you!

Updates (2021-05-01):

  • It is no longer necessary to enable “Feature Preview” in Settings (sudo and Docker support are now Generally Available in Gitpod)
  • It is no longer necessary to manually run sudo docker-up (or even to know about that command, as the Docker daemon now starts automatically when needed)

TL;DR: Just running docker-compose up in any Gitpod workspace should work out-of-the-box.

Woah!
No more sudo docker-up?

Out of curiosity, can you point me to the issue/PR that removed that requirement?

1 Like

Yes! :raised_hands:

Sure! The PR is here: [docker] Introduce socket activated docker-up by csweichel · Pull Request #4018 · gitpod-io/gitpod · GitHub