How to use Docker Dev Environment to code
Have you ever found yourself trying to debug software using a really old language version? Or coding with some arcane libraries that specific conditions to run?
I have been in this situation trying to run an Autodesk Forge repo or trying to run a geometric processing backend that was coded by someone else and lost hours just by trying to make it work because the conditions in my computer were not the same as the owner of the code.
Fear no more! Docker has created a new product aiming to solve all those problems: Docker Dev Environment. This allows you to set up repeatable development environments to share work-in-progress with your team, without any conflicts about the stuff installed in each device.
What is Dev Environment?
Docker creates an emulation of an operating system standardizing the environment so you can run your code on any compatible computer.
The critical difference between a frequent Docker container and a Dev Environment container is that you will easily manage code and debug easily to the container without any fuzz.
Just create a new safe environment, clone a git repo and open it with Visual Studio Code.
How does this work?
First, you need to get Docker Desktop and WSL (if you are on a windows machine like me).
Go to Dev Environments and create a new one.
After the presentation and instructions, you will be prompted to select a git repository online/local or a published Docker image.
After you select your preferred option, Docker will start building the image.
Custom Docker image
You can customize the process by creating a .docker folder in your repository containing a config.json where you can point to a specific Docker image you want to use (in case you don’t use an online template) or even set up your Dockerfile.
After solving the process, you will see your new Dev Environment ready to access from Visual Studio Code.
You have a functional system environment: install packages if needed or debug its tunneling to the localhost without affecting your current system or installing garbage packages.
Best of all? It’s a Docker so you can share it and be sure the other person working with you will receive the same environment.
Would you try it?
I'm an Architect who decided to make his life easier by coding. Curious by nature, I approach challenges armed with lateral thinking and a few humble programming skills. Love to work with passioned people and push the boundaries of the industry. Bring me your problems/Impossible is possible, but it takes more time.