You may choose the one you want, but for this demo we will be using the Ubuntu template: Open the Command pallette in VS Code by using Ctrl+Shift+P (Linux/Windows) or Cmd+Shift+P (macOS) and search for Remote ContainersĬhoose Add Development Container Configuration Files.Ī number of templates is available. We are now ready to create our first dev container. Select “Yes, I trust the authors” when the new empty folder is being opened in VS Code. Step 2 - Create a new folderĬreate a new, empty folder with the purpose of creating your first dev container. This contains the “Remote - Containers” extension as well as two other very useful extensions: “Remote SSH” for connecting to remote SSH targets as well as “Remote - WSL” which makes it very convenient to work with the Windows Subsystem for Linux from VS Code on Windows. Tip: Alternatively, you may install the “Remote Development” extension pack at the bottom of the above screenshot. Next, search for “remote containers”:Ĭlick on “Remote - Containers” and click the Install button which becomes available after clicking on the button. Open VS Code and navigate to the Extensions item in the sidebar. The first thing we are going to do after installing the prerequisites is to install the VS Code Remote - Containers extension. Step 1 - Install the Visual Studio Code Remote - Containers extension A computer running either Linux, macOS or Windows.Prerequisitesīefore you begin this guide you’ll need the following: When you’re finished, you’ll be able to leverage dev containers both for your personal projects as well as for team projects and have a consistent development environment. In this guide, you will learn how to set up VS Code development containers - which makes this possible: So how can containers assist with the development environment challenges discussed above? What if we could leverage containers and host each project we are working on in VS Code inside a fully isolated environment? Portability, being able to run the software consistently across different environments such as on-premises or different cloud vendors, is another advantage containers brings to the table. Container technologies was born with these exact challenges as one of their main tasks to solve. This is not a problem new to the world of software and infrastructure. In the end, there is a whole lot of variations which can make it very challenging to have a consistent development environment. Even when using the same operating system, there might be differences related to versions and patch levels. Lastly, there are different versions of the tools mentioned as well as the related prerequisites such as PowerShell modules and various libraries.Īnother aspect is that people use different platforms, such as Linux, macOS and Windows. Along with these example stack of tools comes additional prerequisites, such as VS Code extensions, PowerShell modules, linting tools and so on. The specific tools needed will of course vary from project to project, but some common ones might be Terraform for declarative configurations, PowerShell for scripting and administrative tasks and VS Code as an editor. In this article, we will use the Infrastructure as Code and cloud automation as our main scenario. One of them is the lead time for onboarding new members to a team or a project, due to prerequisites needed for the tasks the new person will be working on. When working with code, whether it is software, Infrastructure as Code or other purposes, there are some common challenges.
0 Comments
Leave a Reply. |