Containerize your development environment.

High chance you guessed it right, we will be using Docker.

Docker is a great, famous, and very tool. But remember if you use it wrong you end up breaking the traffic of your CI/CD, so don't forget to practice and to use proper versioning organization.



Before you continue, this article is covering only the use of VSCode, If you want to know how you can use other Editors to achieve your goal, you have to do some more digging (if you found something interesting, I'd love if you share it with me 😉 )

Why I would do this?

I know you're here because you already had reasons to think it's a good idea to sync the development environment between the team members.

Maybe you want to add my situation to your reasons, I work with flutter, recently they released Flutter 2 which has breaking changes if you want to upgrade.

If you have a small project that depends on one or two packages or maybe no packages at all like my pet project Dart Stack you might need to upgrade your project (sometimes your users will ask you to do that if it's a package).

If you have a big project like the super-secret very important amazing app I'm working on with a team of the top flutter developers, you will have way many packages to depend on that need to be upgraded first and that would take time, an unknown number of days or weeks.

Well, having two laptops is a solution, a silly one though?

Maybe you will upgrade and downgrade your SDK every time you switch between projects, if you think you can do that you might as well develop a 3D game using assembly language and vim, nobody wants to do that.

But, If you can use Docker to have isolated different machines to use for different projects, that would be amazing.

Let's get to work

First of all, you need to have Remote Tools extension installed in your VSCode, Maybe you would love to have Docker extension as well.

Now create the file .devcontainer/devcontainer.json and add this inside:


{
  "name": "Put a name here",
  "image": "put image name here",
  "extensions": [extensions you need them installed in vscode in the container]
}

for example, my flutter file would look like this:

{
  "name": "Flutter",
  "image": "cirrusci/flutter:stable",
  "extensions": ["dart-code.dart-code", "dart-code.flutter"]
}

You can find a reference to the file Here.

Now all you need to do is to open the command palette (Cmd+Shift+P in MAC) and write "Reopen in container".

That's it, You're all set, very simple right?

Yeah, you should figure out other complicated stuff like preparing the docker image that has all things you need, maintaining that image as well, but just imagine how much work that would save for you? probably a lot.

Comments

  1. My first symptoms of ALS occurred in 2011, but was diagnosed in 2013. I had severe symptoms ranging from shortness of breath, balance problems, couldn't walk without a walker or a power chair, i had difficulty swallowing and fatigue. I was given medications which helped but only for a short burst of time, then I decided to try alternative measures and began on ALS Formula treatment from Dr Oso herbal center, It has made a tremendous difference for me via email: drosohaberhome@gmail.com  . I had improved walking balance, increased appetite, muscle strength, improved eyesight and others. DR oso treatment is the best treatment ever,  please try and contact him for any kind of virus or disease .  

    Email} drosohaberhome@gmail.com

    WhatsApp /call +2348162084839

    https://sites.google.com/view/drosohaberhome/

    His blog pagehttps://drosohaberhome.blogspot.com

    you can also email me for more information about DR oso via troyabl100@gmail.com ALL THANK TO DR OSO .

    ReplyDelete

Post a Comment

Popular posts from this blog

Teaching programming to children can be evil

Why GitHub?

Chatbots and self injury messages