{"id":70517,"date":"2023-03-06T09:27:47","date_gmt":"2023-03-06T17:27:47","guid":{"rendered":"https:\/\/github.blog\/?p=70517"},"modified":"2023-03-07T09:07:32","modified_gmt":"2023-03-07T17:07:32","slug":"how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces","status":"publish","type":"post","link":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/","title":{"rendered":"How to automate your dev environment with dev containers and GitHub Codespaces"},"content":{"rendered":"<p>When I started my first role as a software engineer, I remember taking about four days to set up my local development environment. I had so many issues with missing dependencies, incorrect versions, and failed installations. When I finally finished setting up all the tools and software I needed to be a productive member of the team, I cloned one of our repositories to my machine, set up my environment variables, ran <code>npm run dev<\/code> and received so many errors because I forgot to install the dependencies (and read the README) or switch to the right  node version. Ugh! I can\u2019t tell you how many times this happened to me in my first year!<\/p>\n<p>Back then, I wished I had a way that was streamlined\u2014something I set up only once, that just worked every time I accessed the repository. Although I did learn how to <a href=\"https:\/\/gh.io\/automate-with-brewfile\">automate my computer setup <\/a>with a Brewfile, I wish I could just get to coding in a repository without thinking about configuration.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image2.gif\" alt=\"Gif from the animated show Spongebob Squarepants of a character picking up a computer as if to toss it away, saying &quot;I&#039;ll show you automated.&quot;\"><br \/>\n<small><em><a href=\"https:\/\/media.giphy.com\/media\/v1.Y2lkPTc5MGI3NjExZTEyZThjNjUzNTYyNzZkOGFjMGIyOWQ0ODA4YjU0MzQyZTBlOGYyNCZjdD1n\/l1KtYG8BndKBmWrM4\/giphy.gif\">source<\/a><\/em><\/small><\/p>\n<p>When I think about how we work on projects in a repository, I realize that many of the processes we need to get started on that project can be automated with the help of dev containers, in this case, by using a devcontainer.json file and Codespaces.<\/p>\n<p>Let\u2019s take a look at how we can automate our dev environment by adding a dev container to this open source project\u2014<a href=\"https:\/\/github.com\/TechIsHiring\/techishiring-website\">Tech is Hiring<\/a> in GitHub Codespaces.<\/p>\n<blockquote><p>\n  For a TLDR of this post, GitHub Codespaces enables you to start coding faster when coupled with dev containers. See image below for a summary of how:\n<\/p><\/blockquote>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image1.png?w=940&#038;resize=940%2C788\" alt=\"Image of a table entitled &quot;Start coding faster with Codespaces.&quot; The left column is labeled &quot;Old Way&quot; and the right column is labeled &quot;New Way.&quot; The rest of this blog post will enumerate the items listed in the image.\" width=\"940\" height=\"788\" class=\"aligncenter size-large wp-image-70522 width-fit\" srcset=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image1.png?w=940 940w, https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image1.png?w=300 300w, https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image1.png?w=768 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p>\n<p>Now, let\u2019s get some definitions out of the way.<\/p>\n<h3 id=\"what-is-github-codespaces\"><a class=\"heading-link\" href=\"#what-is-github-codespaces\">What is GitHub Codespaces?<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>GitHub <a href=\"https:\/\/gh.io\/codepaces\">Codespaces<\/a> is a development environment in the cloud. It is hosted by GitHub in an isolated environment (Docker container) that runs on a virtual machine. If you\u2019re not familiar with virtual machines or Docker containers, take a look at these videos: <a href=\"https:\/\/www.youtube.com\/watch?v=N5gworNCJuY\">what is a virtual machine?<\/a> and <a href=\"https:\/\/www.youtube.com\/watch?v=jPdIRX6q4jA\">what are Docker containers?<\/a>.<\/p>\n<p>Currently, individual developers have 60 hours of free codespaces usage per month, so definitely take advantage of this awesomeness to build from anywhere.<\/p>\n<h3 id=\"what-are-dev-containers\"><a class=\"heading-link\" href=\"#what-are-dev-containers\">What are dev containers?<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p><a href=\"https:\/\/containers.dev\/\">Dev containers<\/a> allow us to run our code in a preconfigured, isolated environment (container). It gives us the ability to predefine our dev environment in our repositories and use a consistent, reliable environment across the board without worrying about configuration files\u2014since it\u2019s all set up for us from the beginning with a <code>devcontainer.json<\/code> file.<\/p>\n<h3 id=\"what-is-the-devcontainer-json-file\"><a class=\"heading-link\" href=\"#what-is-the-devcontainer-json-file\">What is the devcontainer.json file?<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>The <code>devcontainer.json<\/code> file is a document that defines how your project will build, display, and run. Simply put, it allows us to specify the behavior we want in our dev environment. For example, if we have a <code>devcontainer.json<\/code> file that includes installing the ESLint extension in VS Code, once we open up a workspace, ESLint will be automatically installed for us.<\/p>\n<h2 id=\"automating-your-workflow-with-dev-containers-and-github-codespaces\"><a class=\"heading-link\" href=\"#automating-your-workflow-with-dev-containers-and-github-codespaces\">Automating your workflow with dev containers and GitHub Codespaces<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>To start using GitHub Codespaces, we don&#8217;t need to set up a <code>devcontainer.json<\/code> file. By default, GitHub Codespaces uses the <a href=\"https:\/\/github.com\/devcontainers\/images\/blob\/main\/src\/universal\/.devcontainer\/devcontainer.json\">universal dev container image<\/a>, which caters to a vast array of languages and tools. This means, whenever you open up a new codespace without a <code>devcontainer.json<\/code> file your codespace will automagically load so you can code instantly. However, adding a <code>devcontainer.json<\/code> file gives us the ability to automate a lot of our dev environment workflows to our liking.<\/p>\n<blockquote><p>\n  Okay, okay, that was a lot of chatter\u2014let\u2019s now get into what you really came here for!\n<\/p><\/blockquote>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image8.gif\" alt=\"Gif of the character Mary Poppins pinching shut the mouth of her talking umbrella handle and telling it, &quot;The will be quite enough of that, thank you.&quot; She then opens the umbrella and floats away.\"><br \/>\n<small><em><a href=\"https:\/\/media.giphy.com\/media\/v1.Y2lkPTc5MGI3NjExYTA0ZTg4OGZkYjNhYmYyOGU5MjFhZTAzMmNmMTFlM2RhYzQyNTgxZSZjdD1n\/bRBufdofrX9e0\/giphy-downsized.gif\">source<\/a><\/em><\/small><\/p>\n<p>Using the open source project, <em>Tech is Hiring<\/em>, let\u2019s walk through how we typically work with a repository using our local dev environment.<\/p>\n<h2 id=\"what-work-typically-looks-like\"><a class=\"heading-link\" href=\"#what-work-typically-looks-like\">What work typically looks like<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>At first glance, we see that this project uses Nextjs, Tailwind CSS, Chakra UI, TypeScript, Storybook, Vite, Cypress, Axios, and Reactjs as some of its dependencies. We\u2019d need to install all these dependencies to our local machine to get this project running.<\/p>\n<ol>\n<li>Let\u2019s clone the repository, and cd into the project.\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image5.gif\" alt=\"Gif of the terminal output as the Tech is Hiring repository is cloned.\"><\/p>\n<\/li>\n<li>\n<p>Then, let\u2019s install dependencies to get the project running locally.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image6.gif\" alt=\"Gif showing terminal output as the necessary dependencies are installed.\"><\/p>\n<\/li>\n<li>\n<p>This project uses storybook, so let\u2019s run both storybook and spin up the actual app locally.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image7-1.gif\" alt=\"Gif of the user&#039;s desktop with a terminal app running commands.\"><\/p>\n<\/li>\n<\/ol>\n<p>The process is not so bad, but it took a bit of time. We also need to check to make sure we\u2019re using the correct node version, check if we need any environment variables, and if there are any runtime errors to resolve. Thankfully, I didn&#8217;t encounter any errors while working on this, but it still took a bit of time.<\/p>\n<h2 id=\"going-faster-with-github-codespaces-and-dev-containers\"><a class=\"heading-link\" href=\"#going-faster-with-github-codespaces-and-dev-containers\">Going faster with GitHub Codespaces and dev containers<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>Let\u2019s make the process better by adding a <code>devcontainer.json<\/code> file to this project and opening it in GitHub Codespaces to see what happens.<\/p>\n<p>We can either use the VS Code command palette to add a pre-existing dev container or we can write the configuration file ourselves (which we\u2019ll do below).<\/p>\n<ol>\n<li>Let\u2019s first create a <code>.devcontainer<\/code> folder in the root of the project and a <code>devcontainer.json<\/code> file in the new folder.\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image3.png?w=612&#038;resize=612%2C142\" alt=\"Creating a a `.devcontainer` folder in the root of the project and a `devcontainer.json` file in the new folder. \" width=\"612\" height=\"142\" class=\"aligncenter size-large wp-image-70528 width-fit\" srcset=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image3.png?w=612 612w, https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image3.png?w=300 300w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/><\/p>\n<\/li>\n<li>\n<p>Now, let\u2019s automate installing dependencies, starting the dev server, opening a preview of our app on localhost:3000, and installing vscode extensions. Once we get everything configured, your json file <a href=\"https:\/\/gh.io\/example-devcontainer\">should look like this<\/a>:<\/p>\n<pre><code>{\n  \/\/ image being used\n   \"image\": \"mcr.microsoft.com\/devcontainers\/universal:2\",\n  \/\/ set minimum cpu\n   \"hostRequirements\": {\n       \"cpus\": 4\n   },\n   \/\/ install dependencies and start app\n   \"updateContentCommand\": \"npm install\",\n   \"postAttachCommand\": \"npm run dev\",\n   \/\/ open app.tsx once container is built\n   \"customizations\": {\n       \"codespaces\": {\n           \"openFiles\": [\n               \"src\/pages\/_app.tsx\"\n           ]\n       },\n       \/\/ install some vscode extensions\n       \"vscode\": {\n           \"extensions\": [\n               \"dbaeumer.vscode-eslint\",\n               \"github.vscode-pull-request-github\",\n               \"eamodio.gitlens\",\n               \"christian-kohler.npm-intellisense\"\n           ]\n       }\n   },\n   \/\/ connect to remote server\n   \"forwardPorts\": [3000],\n   \/\/ give port a label and open a preview of the app\n   \"portsAttributes\": {\n      \"3000\": {\n         \"label\": \"Application\",\n         \"onAutoForward\": \"openPreview\"\n       }\n     }\n}\n<\/code><\/pre>\n<blockquote><p>\n  Sidenote: I\u2019ve broken down the purpose of the properties in this file for you by adding comments before each. To learn more about each property, continue reading at <a href=\"https:\/\/containers.dev\/implementors\/json_reference\/\">container.dev<\/a>. I also installed a few extensions that are not needed, but I wanted to show you that you could automate installing extensions, too!\n<\/p><\/blockquote>\n<\/li>\n<li>Let\u2019s commit the file and merge it into the main branch, then open up the project in GitHub Codespaces.\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/image4.gif\" alt=\"Committing a file, merging it to the main branch, and then opening GitHub Codespaces.\"><\/p>\n<p>When we open up the application in GitHub Codespaces, our dependencies will be installed, the server will start, and a preview will automatically open for us. If we needed environment variables to work on this repository, those would have already been configured for us <a href=\"https:\/\/docs.github.com\/en\/codespaces\/managing-your-codespaces\/managing-encrypted-secrets-for-your-codespaces\">as a repository secret<\/a> on GitHub. We also didn&#8217;t need to install hefty <code>node_modules<\/code> to our machine.<\/p>\n<\/li>\n<\/ol>\n<p>I call this a win!<\/p>\n<h2 id=\"comparing-both-ways\"><a class=\"heading-link\" href=\"#comparing-both-ways\">Comparing both ways<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>There\u2019s plenty more that we can do with dev containers and GitHub Codespaces to automate our dev environment. But let\u2019s summarize what we just did in GitHub Codespaces and with the help of dev containers:<\/p>\n<ul>\n<li>We clicked the GitHub Codespaces button on the GitHub repository.<\/li>\n<li>Everything was setup\/installed for us (thanks json file!).<\/li>\n<li>We got to work and started coding. <\/li>\n<\/ul>\n<p>Now, isn&#8217;t that better?<\/p>\n<h2 id=\"wrapping-up\"><a class=\"heading-link\" href=\"#wrapping-up\">Wrapping up<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h2>\n<p>So, what&#8217;s the point of GitHub Codespaces and why should you care as a developer? Well, for one, you can automate most of the startup processes you need to access a repository. You can also do a lot more customizations to your dev environment with dev containers. Take a look at <a href=\"https:\/\/containers.dev\/implementors\/json_reference\/\">all the options<\/a> you have\u2014and watch out for my next blog post where I\u2019ll go through the anatomy of a <code>devcontainer.json<\/code> file.<\/p>\n<p>Secondly, you can code from anywhere. I hate it when I\u2019m not able to access one of my side projects on a different machine because that one machine is configured perfectly to suit the project. With GitHub Codespaces, you can <strong>start coding at the click of a button<\/strong> and <strong>from any machine<\/strong> that supports a modern browser.<\/p>\n<p>I encourage you to <a href=\"https:\/\/gh.io\/try-codespaces\">get started with GitHub Codespaces<\/a> today and try adding a devcontainer.json file to one of your projects! I promise you won&#8217;t regret it.<\/p>\n<p>Until next time, happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GitHub Codespaces enables you to start coding faster when coupled with dev containers. Learn how to automate a portion of your development environment by adding a dev container to an open source project using GitHub Codespaces.  <\/p>\n","protected":false},"author":2041,"featured_media":70518,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_gh_post_show_toc":"no","_gh_post_is_no_robots":"no","_gh_post_is_featured":"no","_gh_post_is_excluded":"no","_gh_post_is_unlisted":"no","_gh_post_related_link_1":"","_gh_post_related_link_2":"","_gh_post_related_link_3":"","_gh_post_sq_img":"https:\/\/github.blog\/wp-content\/uploads\/2022\/01\/GitHub-Product_teal-square-icon-e1644516262689.png","_gh_post_sq_img_id":"62576","_gh_post_cta_title":"","_gh_post_cta_text":"","_gh_post_cta_link":"","_gh_post_cta_button":"Click Here to Learn More","_gh_post_recirc_hide":"no","_gh_post_recirc_col_1":"gh-auto-select","_gh_post_recirc_col_2":"70306","_gh_post_recirc_col_3":"65314","_gh_post_recirc_col_4":"65316","_featured_video":"","_gh_post_additional_query_params":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"_links_to":"","_links_to_target":""},"categories":[3298,3302],"tags":[1935],"coauthors":[2854],"class_list":["post-70517","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer-skills","category-github","tag-codespaces"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to automate your dev environment with dev containers and GitHub Codespaces - The GitHub Blog<\/title>\n<meta name=\"description\" content=\"GitHub Codespaces enables you to start coding faster when coupled with dev containers. Learn how to automate a portion of your development environment by adding a dev container to an open source project using GitHub Codespaces.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to automate your dev environment with dev containers and GitHub Codespaces\" \/>\n<meta property=\"og:description\" content=\"GitHub Codespaces enables you to start coding faster when coupled with dev containers. Learn how to automate a portion of your development environment by adding a dev container to an open source project using GitHub Codespaces.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/\" \/>\n<meta property=\"og:site_name\" content=\"The GitHub Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-06T17:27:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-07T17:07:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/automate-header.png?fit=1200%2C630\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kedasha Kerr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kedasha Kerr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/\"},\"author\":{\"name\":\"Kedasha Kerr\",\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/c7307d5b9eb99168bed497b7e6b0a950\"},\"headline\":\"How to automate your dev environment with dev containers and GitHub Codespaces\",\"datePublished\":\"2023-03-06T17:27:47+00:00\",\"dateModified\":\"2023-03-07T17:07:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/\"},\"wordCount\":1265,\"image\":{\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/automate-header.png?fit=1200%2C630\",\"keywords\":[\"Codespaces\"],\"articleSection\":[\"Developer skills\",\"GitHub\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/\",\"url\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/\",\"name\":\"How to automate your dev environment with dev containers and GitHub Codespaces - The GitHub Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/github.blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/automate-header.png?fit=1200%2C630\",\"datePublished\":\"2023-03-06T17:27:47+00:00\",\"dateModified\":\"2023-03-07T17:07:32+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/c7307d5b9eb99168bed497b7e6b0a950\"},\"description\":\"GitHub Codespaces enables you to start coding faster when coupled with dev containers. Learn how to automate a portion of your development environment by adding a dev container to an open source project using GitHub Codespaces.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/#primaryimage\",\"url\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/automate-header.png?fit=1200%2C630\",\"contentUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/automate-header.png?fit=1200%2C630\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/github.blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Developer skills\",\"item\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"GitHub\",\"item\":\"https:\\\/\\\/github.blog\\\/developer-skills\\\/github\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to automate your dev environment with dev containers and GitHub Codespaces\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/github.blog\\\/#website\",\"url\":\"https:\\\/\\\/github.blog\\\/\",\"name\":\"The GitHub Blog\",\"description\":\"Updates, ideas, and inspiration from GitHub to help developers build and design software.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/github.blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/c7307d5b9eb99168bed497b7e6b0a950\",\"name\":\"Kedasha Kerr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f7068adc72a5044fad52dad7d2a26c374860c1e491761f8ec5cf7750152f4adb?s=96&d=mm&r=g76275409088bcdfde49439d0290b472b\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f7068adc72a5044fad52dad7d2a26c374860c1e491761f8ec5cf7750152f4adb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f7068adc72a5044fad52dad7d2a26c374860c1e491761f8ec5cf7750152f4adb?s=96&d=mm&r=g\",\"caption\":\"Kedasha Kerr\"},\"description\":\"Kedasha is a Developer Advocate at GitHub where she enjoys sharing the lessons she's learned with the wider developer community. She finds joy in helping others learn about the tech industry and loves sharing her experience as a software developer. Find her online @itsthatladydev.\",\"url\":\"https:\\\/\\\/github.blog\\\/author\\\/ladykerr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to automate your dev environment with dev containers and GitHub Codespaces - The GitHub Blog","description":"GitHub Codespaces enables you to start coding faster when coupled with dev containers. Learn how to automate a portion of your development environment by adding a dev container to an open source project using GitHub Codespaces.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/","og_locale":"en_US","og_type":"article","og_title":"How to automate your dev environment with dev containers and GitHub Codespaces","og_description":"GitHub Codespaces enables you to start coding faster when coupled with dev containers. Learn how to automate a portion of your development environment by adding a dev container to an open source project using GitHub Codespaces.","og_url":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/","og_site_name":"The GitHub Blog","article_published_time":"2023-03-06T17:27:47+00:00","article_modified_time":"2023-03-07T17:07:32+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/automate-header.png?fit=1200%2C630","type":"image\/png"}],"author":"Kedasha Kerr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kedasha Kerr","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/#article","isPartOf":{"@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/"},"author":{"name":"Kedasha Kerr","@id":"https:\/\/github.blog\/#\/schema\/person\/c7307d5b9eb99168bed497b7e6b0a950"},"headline":"How to automate your dev environment with dev containers and GitHub Codespaces","datePublished":"2023-03-06T17:27:47+00:00","dateModified":"2023-03-07T17:07:32+00:00","mainEntityOfPage":{"@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/"},"wordCount":1265,"image":{"@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/#primaryimage"},"thumbnailUrl":"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/automate-header.png?fit=1200%2C630","keywords":["Codespaces"],"articleSection":["Developer skills","GitHub"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/","url":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/","name":"How to automate your dev environment with dev containers and GitHub Codespaces - The GitHub Blog","isPartOf":{"@id":"https:\/\/github.blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/#primaryimage"},"image":{"@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/#primaryimage"},"thumbnailUrl":"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/automate-header.png?fit=1200%2C630","datePublished":"2023-03-06T17:27:47+00:00","dateModified":"2023-03-07T17:07:32+00:00","author":{"@id":"https:\/\/github.blog\/#\/schema\/person\/c7307d5b9eb99168bed497b7e6b0a950"},"description":"GitHub Codespaces enables you to start coding faster when coupled with dev containers. Learn how to automate a portion of your development environment by adding a dev container to an open source project using GitHub Codespaces.","breadcrumb":{"@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/#primaryimage","url":"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/automate-header.png?fit=1200%2C630","contentUrl":"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/automate-header.png?fit=1200%2C630","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/github.blog\/developer-skills\/github\/how-to-automate-your-dev-environment-with-dev-containers-and-github-codespaces\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/github.blog\/"},{"@type":"ListItem","position":2,"name":"Developer skills","item":"https:\/\/github.blog\/developer-skills\/"},{"@type":"ListItem","position":3,"name":"GitHub","item":"https:\/\/github.blog\/developer-skills\/github\/"},{"@type":"ListItem","position":4,"name":"How to automate your dev environment with dev containers and GitHub Codespaces"}]},{"@type":"WebSite","@id":"https:\/\/github.blog\/#website","url":"https:\/\/github.blog\/","name":"The GitHub Blog","description":"Updates, ideas, and inspiration from GitHub to help developers build and design software.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/github.blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/github.blog\/#\/schema\/person\/c7307d5b9eb99168bed497b7e6b0a950","name":"Kedasha Kerr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f7068adc72a5044fad52dad7d2a26c374860c1e491761f8ec5cf7750152f4adb?s=96&d=mm&r=g76275409088bcdfde49439d0290b472b","url":"https:\/\/secure.gravatar.com\/avatar\/f7068adc72a5044fad52dad7d2a26c374860c1e491761f8ec5cf7750152f4adb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f7068adc72a5044fad52dad7d2a26c374860c1e491761f8ec5cf7750152f4adb?s=96&d=mm&r=g","caption":"Kedasha Kerr"},"description":"Kedasha is a Developer Advocate at GitHub where she enjoys sharing the lessons she's learned with the wider developer community. She finds joy in helping others learn about the tech industry and loves sharing her experience as a software developer. Find her online @itsthatladydev.","url":"https:\/\/github.blog\/author\/ladykerr\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/github.blog\/wp-content\/uploads\/2023\/03\/automate-header.png?fit=1200%2C630","jetpack_shortlink":"https:\/\/wp.me\/pamS32-iln","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/70517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/users\/2041"}],"replies":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/comments?post=70517"}],"version-history":[{"count":19,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/70517\/revisions"}],"predecessor-version":[{"id":70520,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/70517\/revisions\/70520"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/media\/70518"}],"wp:attachment":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/media?parent=70517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/categories?post=70517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/tags?post=70517"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/coauthors?post=70517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}