Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

A First Look at Dev Environments Feature under Docker Desktop 3.5.0

3 min read

Starting Docker Desktop 3.5.0, Docker introduced the Dev Environments feature for the first time. The Dev Environments feature is the foundation of Docker’s new collaborative team development experience. It provides a simple way for developers to share their work in progress code, connect code into a container to edit it/rebuild it and a way to do this within a compose project using one container as your development environment while still running the others. It keeps your development container backed up, up to date, and provides simple tools to share these with your team so anyone can look at what you’re working on in one click.

It is currently offered as a Preview and shouldn’t be used in production environments. VS Code is the only supported IDE as of now, but you can expect a bunch of other IDE vendors in the near future.

To access Dev Environments, from the Docker menu, select Dashboard > Dev Environments.

Why does your team require Dev Environments?

Imagine your team is working on a Git project that has a development, experiment, and production branch. Your team uses a development branch to build the next version, an experimental branch to try exploring the new ideas, and the production branch that requires maintenance. Switching between these branches on a single machine could be complex and tedious at the same time, particularly if the dependencies are different. The isolation of using a different container for each branch may help.

With Dev Environments, developers can now easily set up repeatable and reproducible development environments by keeping the environment details versioned in their SCM along with their code. Once a developer is working in a Development Environment, they can share their work-in-progress code and dependencies in one click via the Docker Hub. They can then switch between their developer environments or their teammates’ environments, moving between branches to look at work-in-progress changes without moving off their current Git branch. This makes reviewing PRs as simple as opening a new environment.

Dev Environments use tools built into code editors that allow Docker to access code mounted into a container rather than on the developer’s localhost. This isolates the tools, files, and running services on the developer’s machine allowing multiple versions of them to exist side by side, also improving file system performance!  And we have built this experience on top of Compose rather than adding another manifest for developers to worry about or look after. 

How is Dev Environments different from GitPod and GitHub Codespaces?

Good question! If you have ever used GitPod or GitHub Codespaces, you might wonder how is Dev Environments different from these existing ones. If you look closely at GitPod, it is an open-source Kubernetes application for automated and ready-to-code development environments that blends in your existing workflow. It does work very similarly, enables you to describe your dev environment as code and start instant and fresh development environments for each new task directly from your browser. Tightly integrated with GitLab, GitHub, and Bitbucket, Gitpod automatically and continuously prebuilds dev environments for all your branches. As a result, team members can instantly start coding with fresh, ephemeral, and fully-compiled dev environments – no matter if you are building a new feature, want to fix a bug, or do a code review. On the other hand, GitHub Codespaces is a configurable online development environment, hosted by GitHub and powered by Visual Studio Code.

The major difference between Dev Environments Vs GitPod/Codespaces is in the way it runs. GitPod and Codespaces run in the cloud, and collaboration is based on working on the same code repository, whereas Docker Development Environments run locally, and enable sharing of work in progress as a complete working piece.

Getting Started

Step 1. Download and install Docker Desktop 3.5.0 or higher:

Step 2. Install the tools and extensions

Step 3. Start a single container Dev Environment

Go to Dev Environments > Click on Single container dev environment. We will be using an example to try a single container sample of Docker Dev Environments.

In the above example, the names lucid_napier and vigilant_lalande are randomly generated. You’ll most likely see different names when you create your Dev Environment.

Hover over the container and click Open in VS Code to start working in VS Code as usual. You can also open a terminal in VS Code, and use Git to push or pull code to your repository, or switch between branches and work as you would normally.

You can launch the application by running the command “make run” in your VS Code terminal.

Step 4. Access the HTTP application

This opens an HTTP server on port 8080. Open http://localhost:8080 in your browser to see the running application.

❯ curl http://localhost:8080

          ##         .
    ## ## ##        ==
 ## ## ## ## ##    ===
/"""""""""""""""""\___/ ===
{                       /  ===-
\______ O           __/
 \    \         __/
  \____\_______/


Hello from Docker!

Step 5. Sharing Your Dev Environments

If you’re not a member of the Docker Team Plan, then this is the time to upgrade from the free plan to the Team Plan.

If you are a member of the Docker Team plan, you can now share your Dev Environment with your team. When you are ready to share your environment, just click the Share button and specify the Docker Hub namespace where you’d like to push your Dev Environment to.

This creates a Docker image of your dev environment, uploads it to the Docker Hub namespace you have specified in the previous step, and provides a tiny URL that you can use to share your work with your team members. Your team members just need to add this URL in the Create field and then click Create. Your Dev Environment now starts in the exact same state as you shared it! Using this shared Dev Environment, your team members can access the code, any dependencies, and the current Git branch you are working on. They can also review your changes and provide feedback even before you create a pull request!

In the next post, we will use Dev Environments to collaborate on any Docker Compose-based projects. Stay tuned!

References:

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

41 Replies to “A First Look at Dev Environments Feature under Docker…”

  1. Hey there superb website! Does running a blog similar to
    this take a lot of work? I have very little knowledge of computer programming however I was hoping to start my own blog soon. Anyhow, if you have any
    ideas or tips for new blog owners please share.
    I know this is off subject nevertheless I simply wanted to ask.
    Appreciate it!

  2. I think this is among the most vital information for me. And i’m glad reading your article. But want to remark on few general things, The site style is perfect, the articles is really excellent : D. Good job, cheers

  3. You actually make it seem really easy with your presentation but I in finding this matter to be actually something that I believe I might by no means understand. It sort of feels too complicated and very extensive for me. I am looking forward in your subsequent publish, I?¦ll try to get the dangle of it!

  4. Hi, I think your site might be having browser compatibility issues. When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!

  5. After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think.

  6. Good ?V I should definitely pronounce, impressed with your site. I had no trouble navigating through all the tabs as well as related information ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or something, website theme . a tones way for your client to communicate. Excellent task..

  7. Hi,i feel that i saw you visited my site thus i got here to go back the desire?.I’m trying to find issues to enhance my web site!I assume its ok tto use a few of your concepts!!

    Pharmacologie du sport webpage commment pomper la presse

  8. But a smiling visitor here to share the love (:, btw outstanding design. “Justice is always violent to the party offending, for every man is innocent in his own eyes.” by Daniel Defoe.

  9. Fantastic goods from you, man. I have understand your stuff previous to and you’re just extremely excellent. I really like what you’ve acquired here, really like what you’re stating and the way in which you say it. You make it entertaining and you still care for to keep it sensible. I can not wait to read much more from you. This is really a wonderful website.

  10. You really make it seem so easy together with your presentation but I find this topic to be really something which I think I’d never understand. It seems too complicated and extremely large for me. I’m looking forward to your subsequent put up, I?¦ll try to get the grasp of it!

  11. You actually make it seem so easy together with your presentation however I find this topic to be actually one thing which I believe I would never understand. It sort of feels too complex and very wide for me. I am looking forward on your subsequent put up, I¦ll attempt to get the hang of it!

  12. Usually I do not read article on blogs, but I would like to say that this write-up very forced me to try and do it! Your writing style has been amazed me. Thanks, very nice article.

  13. I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.

  14. Hello my friend! I want to say that this post is awesome, great written and include approximately all important infos. I?¦d like to look more posts like this .

  15. Wow! This blog looks just like my old one! It’s on a totally different subject but it has pretty much the same layout and design. Wonderful choice of colors!

  16. Hi would you mind stating which blog platform you’re working with? I’m looking to start my own blog soon but I’m having a tough time choosing between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then most blogs and I’m looking for something completely unique. P.S Apologies for getting off-topic but I had to ask!

  17. A lot of thanks for your own work on this website. My niece really likes managing internet research and it’s simple to grasp why. My partner and i notice all of the compelling medium you offer invaluable secrets on the website and even improve contribution from website visitors about this subject matter while our favorite child is now starting to learn a great deal. Enjoy the remaining portion of the new year. You have been performing a brilliant job.

  18. I like the helpful information you provide for your articles. I will bookmark your blog and take a look at again here frequently. I’m slightly sure I will be informed plenty of new stuff right here! Good luck for the following!

  19. Great amazing things here. I?¦m very glad to look your article. Thanks a lot and i’m taking a look forward to touch you. Will you please drop me a mail?

  20. I wanted to thank you for tjis good read!! I absolutely loved every bit off it.
    I’ve got you bookmarked too check out new stuff you post…
    how to train muscles web page train muscles

  21. Hello there! Would you mind if I share your blog with my myspace group? There’s a lot of people that I think would really appreciate your content. Please let me know. Thank you

  22. Hi would you mind stating which blog platform you’re using? I’m going to start my own blog in the near future but I’m having a tough time choosing between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then most blogs and I’m looking for something unique. P.S Apologies for getting off-topic but I had to ask!

  23. fantɑstic submit, very informative. I’m wondering why thе opposite experts of this sector don’t understand this.
    Yoս must proceed your ԝriting. I am sure, you have a huge readеrs’ base
    already!

Leave a Reply

Your email address will not be published.