Unify Development Environment via VSCode remote-containers

Prologue

I was a heavy user of and with a long time, but maintain them to make sure the development environment can be deployed as usual sometimes make me feel annoy, especially cross multiple Linux distribution or versions. All of my existing projects have been migrated to container solution in recent years, then “Utilize the well packed docker image as development environment must be a good idea.”

Concepts

VSCode remote-containers provide an excellent and isolate development environment for developers, and it would be possible to utilize the benefit and merge with our application image that we are running on production.

Thanks for the container design, we could simply stack the remote-container layer to an existing docker image like following diagram:

Based on above concept, we should refer to the and snipping some of them to my existing Dockerfile. Following section shows a sample project which is already adapt this concept and works on VSCode.

Instructions

Step 1. Install Docker and VSCode with the extension: remote-containers

Step 2. Clone the sample project : and execute following commands

# Clone repo
git clone git@github.com:cjy0125/godevcontainer.git
cd godevcontainer
# Prepare resources for remote container
bash ./setup_script.sh alpine

Step 3. Open remote container in VSCode

Click the button at bottom left corner, and choose “Remote-Containers: Open Folder in Container”, then select the folder that we cloned in previous step.

Step 4. Wait the development container build success

Once the development environment is ready, then we could save this in project manager.

Epilogue

Unify development environment is always a key point to put all the cooperators on the same page. In addition it could mitigate the gap and assist the new comer to start contribution ASAP.

References

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Charles Yang

An engineer keeps pursuing the efficient way of software development