0

Motivation

Running DDEV for a diverse team of developers (front-end / back-end) on various operating systems (Windows, MacOS and Linux) can become time-consuming, even frustrating at times.

Hoping to simplify the initial setup, I started working on an automated VS Code Remote Container setup.

I want to run DDEV in a VS Code Remote Container.

To complicate things, the container should reside on a remote host.

This is the current state of the setup: caillou/vs-code-ddev-remote-container#9ea3066

Steps Taken

I took the following steps:

  1. Set up VS Code to talk to a remote Docker installation over ssh. You just need to add the following to VS Code's settings.json: "docker.host": "ssh://username@host".
  2. Install Docker and create a user with UID 1000 on said host.
  3. Add docker-cli, docker-compose, and and ddev to the Dockerfile, c.f. Dockerfile#L18-L20.
  4. Mount the Docker socket in the container and use the remote user with UID 1000. In the example, this user is called node: devcontainer.json

What Works

Once I launch the VS Code Remote Container extension, an image is build using the Dockerfile, and a container is run using the parameters defined in the devcontainer.json.

I can open a terminal window and run sudo docker ps. This lists the container I am in, and its siblings.

My Problem

  1. DDEV needs to create docker containers.
  2. DDEV can not be run as root.
  3. On the host, the user with UID 1000 has the privilege to run Docker.
  4. Within the container, the user with UID 1000 does not have the privilege to run Docker.

The Question

Is there a way to give an unprivileged user access to Docker within Docker?

Pierre Spring
  • 10,525
  • 13
  • 49
  • 44
  • Back in the day, there was https://github.com/jpetazzo/dind. But that's obsolete, and I haven't heard of any way to run docker inside docker in recent years. – rfay Jan 06 '21 at 03:17
  • 1
    Slowly getting there with `nestybox/sysbox`. Will write an answer, if I succeed that way. – Pierre Spring Jan 06 '21 at 15:50

0 Answers0