Welcome back! In our last lesson, we took a look at downloading and installing Docker Desktop on our Windows machine. So why bother using a developer environment when we could just use the command line? Great question. Using a Dev (or “developer”) environment offers a great deal of flexibility when we’re developing with Docker. To start with, Docker works very well with Microsoft Visual Studio Code which, in turn, gives us access to a large number of features and tools to program with.
Clicking on “Create New Environment”, we’re greeted with a splash screen detailing some advantages of the Docker Developer Environments. Click on “Get Started”. On the next screen, we have two options — we can either create a New Dev Environment using an Existing Git Repo(sitory), or by using a local directory. Additionally, we can use an existing developer environment. Since we’re starting from scratch, let’s choose “New Dev Environment -> Local Directory”.
Clicking “Select”, a dialogue box opens, expecting us to navigate to a folder we’ve already created. For this example, I’ve already created a folder on my Desktop titled “docker_intro”, with no files in it.
Once I’m within the folder I want to use to store all my Docker files, I’ll click “Select Folder,” and confirm the destination using the “Select” button again. Once I do this, Docker Desktop begins preparing my Dev Environment; depending on the size of your environment, this can take a moment. After the Dev Environment is created, we click Continue to move to the next screen.
By default, Docker Desktop will create an environment with a goofy name and it will provide us with a button to auto-open our environment in Microsoft VS Code. In this case, we’ll be working in an environment called “sleepy_banach” inside a container called “relaxed_vaughan”.
You read that correctly — our developer environment (dev. env.) placed us directly inside a Docker container! This makes sense; any files we develop within our environment are likely files we will want to be packaged together, the very definition of a container.
Now that we are in an environment, we notice a few things. First, each page within our Docker Desktop is populated. The container screen shows the container we’re in (relaxed_vaughan), the image shows a default environment image created by Docker, the Volumes tab shows a default volume to store any data we generate, and our Dev Environment shows our newly generated environment.
Hovering over our environment (relaxd_vaughan) within the container (sleepy_banach), we have the options to Open in VScode, Stop the environment, or we can execute the environment in a Command Line Interface (CLI), restart or rename the environment, or we can delete the environment altogether.
Next, we’ll look at building and running Docker files within the VS Code environment. In the meantime, I hope you found the content helpful!
Get new content delivered directly to your inbox.