question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to run "docker in docker"

See original GitHub issue

Is your enhancement related to a problem? Please describe.

I’m working with Quarkus applications. Quarkus has this feature called DevServices. If my application requires a database, a Kafka broker, a Keycloak instance, or an Apicurio registry, when I run or test my Quarkus application (i.e. inner-loop development cycle) Quarkus can automatically spin up one of these containers for me and then shut it down when I shut down my application. Under the covers, Quarkus uses Testcontainers to do this.

This problem I’m having extends past Quarkus applications as well. Using Testcontainers directly (say in any other kind of Java application) I can satisfy many external dependencies that my application might need when running its tests (again, inner-loop development).

In Eclipse Che, this is impossible because there is no container runtime exposed to the workspace. I am not at all able to execute my test suite inside Eclipse Che.

Describe the solution you’d like

Ideally I’d like to just run mvn verify in my source tree (for a Java project) and have things just work. If my code uses Testcontainers, let Testcontainers do its “thing”. If Quarkus, let Quarkus do its “thing”.

Describe alternatives you’ve considered

Others have run into similar issues with things like Tekton, where as a step in the pipeline run they need to run mvn verify and have Testcontainers do its thing. They’ve solved that by using the docker-dind (docker-in-docker) image as a sidecar container and sharing the volume between the sidecar & “main” containers (see this great article that was written by someone who got this working in Tekton).

I tried to apply that same pattern to a CRW workspace using a sidecar image, mounting volumes, etc, but it doesn’t work, probably because of privileged access/etc.

WIthout something like this it really is impossible to use Testcontainers to run my test suite or to even run a Quarkus application “locally” (inner-loop) within a CRW workspace.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
l0rdcommented, Aug 30, 2021

@edeandrea not when we tested ~1 year ago. But it looks like things have changed and we need to have a look again (c.f. this issue and related OpenShift enhancement proposal.

1reaction
l0rdcommented, Aug 10, 2021

@brootware @edeandrea we understand the value of this feature. But allowing arbitrary developers to run a pod with

securityContext:
    privileged: true

as in the Tekton example will fail on real world kubernetes clusters (c.f. https://snyk.io/blog/10-kubernetes-security-context-settings-you-should-understand/). For instance it won’t work on Red Hat developer sandbox.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it ok to run docker from inside docker?
To run docker inside docker is definitely possible. The main thing is that you run the outer container with extra privileges (starting with...
Read more >
Docker can now run within Docker
Docker can now run within Docker ... One of the (many!) features of Docker 0.6 is the new “privileged” mode for containers. It...
Read more >
How (and Why) to Run Docker Inside Docker
Running Docker inside Docker lets you build images and start containers within an already containerized environment.
Read more >
How to Run Docker Inside Docker?
In this blog, I will explain the steps required to run docker in docker using two different methods. When do you need it?...
Read more >
The simple way to run Docker-in-Docker for CI
Docker doesn't recommend running the Docker daemon inside a container (except for very few use cases like developing Docker itself), and the solutions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found