Docker Community Forums

Share and learn in the Docker community.

Creating a developer environment entirely on Docker

Hi, I am struggling with new developers that we hire to give them the best and fastest environemnt to work on. I’m talking about their desktop pc. So I thought, why not build a Docker image that contains everything they need to develop. I’m talking about installed VSCode, git, nodejs, npm, python, .net Core and more inside the image, with a GUI interface exposed with VNC.
This way I can achieve:

  1. An updated environment (I just need to re build the image with the newer packages)
  2. Every developer will just pull the image from the artifactory and can start working. Everything will be configured as we need it to be. All persistent files and custom configurations can be save in the Host so they won’t be deleted.

What do you think? What am I missing?
I’ll also thank any link or help at installing the GUI inside the docker. I saw there are some ready images with it, I would prefer building my own image (based on Ubuntu:20.04).


Since you asked “What do you think?”: I would look for another job if I were expected to use VNC to access my development environment. And when hiring developers, I feel even juniors just need to wade into maintaining the toolset they need for their development work; that’s just invaluable knowledge they will use later on, like when debugging production problems. To me, creating such environment feels like a waste of time.

(Which is not to say that images to provide dependencies such as databases, RabbitMQ or Redis, or provide programming environments such as specific versions of Node, Python, .NET and all, may be very helpful. But IDEs and such: not for me.)

1 Like

I really am interested in your opinion. Thanks!

Still to this day, I prepare vagrant boxes for each project. The naked base image is a minimal xubuntu core 20.04 with ansible created by packer and run on Virtualbox (since version 6.1.20 the UI experience returned to be statisfying).

Per project I tailor the ansible roles that need to be included for the particular project. Once you have a broad set of ansible roles, creating the setup for a new project becomes a matter of minutes.

I only use docker where it’s a first-class citizen: on linux.

@meyay am I right to assume that such images/boxes only contain things related to the software that is being created, so not including git, some IDE, and all?

Nope, they include the whole toolset. Once a developer is onboarded regarding the project specifics, setting up such a vagrant box takes roughly 10-30 minutes (depending on network speed at that moment). As a result the devs get a customized environment that is ready to be used (as in AWS Access Key and Secret configured, ssh certificate for CodeCommit created and registered, CodeArtifact token generated during login and whatever nasty commes to mind). And the beauty is: if they messup their boxes, they just destroy the instance and create a new one. If a problem with one of the ansible roles is identified, it is fixed in the ansible role, pulled by all devs and provisioned for everybody.

Intellij and visual studio code are okay to use on a 4k screen within these vms.

Back in the days, when I was still a developer, I was tired out finding incomplete or outdated documentation on how the development environment needs to be set up every in project I joined . This is why I quickly shifted over to automate the whole setup process. Nothing is more honest than the current code :slight_smile:

Even more: I’d do the same if being expected to use a specific IDE, keyboard mapping, color scheme, … :slight_smile:

So far all my devs like/liked it and some even adopted it to for later projects. A vagrant template project to fork and the ansible roles are shared amongst the project and accessible within the company, while project specific vagrant configurations are only accessible for the members of a project. The ansible roles are lazy fetched if specified in a required.yml. Every ansible role allows to override the configuration to an extend, like specifiying different versions of a package/tool/application or providing a different list of plugins to install with the IDE (done that with eclipse and visual studio code in the past).

I can say from experience, no one accepts a forced configuration of the IDE. I tried it once and learned quickly that it is a no go area. Been there, done that and learned from my mistakes :slight_smile:

Thank you all for your comments!
I think we’ll drop out from this and just make an ansible role or something like that to ease the access of new developers.
Great discussion!

Aside, in case you need more ideas, I just saw Laradock being mentioned on the forum here:

The whole disucssion made look at wls2 again. Actualy It is possible to use packer with the lxd and lxc provisionier to create a customized lxd/lxc image that can be easily modified to work with wls2 - if wanted even with systemd enabled. Once WSLg (with gui support) is GA, this might be a viable option.

But then again, the same can be done with docker.

@javitolin are you aware that Visual Studio Code has remote plugins for wls, docker and ssh, that allow to work as if you are inside that environment? You can open terminals and fire command or simply benefit from the inotify watches vscode uses to detect changed files (hint: usefull with based git projects).

Yes, I wanted to ease the entrance of a junior developer and give him an entire setup at once, being able to update it and change it pretty easly. We back down from this for now…