* Draft - add copy from Google doc * Add images * More WiP * test (#25121) * Update actions-scheduled-workflow-example.md The editor when changing a CRON time says the most frequent is 5 minutes. Either this section is incorrect or the editor pop over.. * Fix "labels" type * Add apps permissions for code scanning org endpoint. (#24859) * cope with possible translation drift (#24842) * cope with possible translation drift * fix test * don't shallow clone * fix unit tests * update code comments * more code comment corrections * more code comment * feedbacked * Add 💅 * Remove yzhang.markdown-all-in-one extension The markdown-all-in-one extension prevents Alfred expansions happening correctly. * Revert Add apps permissions for code scanning org endpoint (#25023) * Add security overview to github-security-features.md * updating ghcr_token github_token * archived asset redirects (#25025) * updating ghec_token to github_token * set 'manul-purge' surrogate key on assets/cb- URLs (#25028) * Member privileges edit for forking help doc (#24934) * calm down Backfill logging (#25031) * [Feb. 2, 2022] Updates for settings nav redesign (#24604) * Replace accessibility-tab.png with octicon * Update and version appearance-tab references * Replace codespaces-tab.png with octicon * Replace product name with reusable * Version reusable using developer-settings.png * Version reusable using notifcations_menu.png * Replace org-settings-pages.png with octicon * Version reusable using repos-tab.png * Version reusable using saved-replies-tab.png * Version reusable with settings-applications.png * Version reusable with settings-sidebar-account-security.png * version reusable with settings-sidebar-account-settings.png * Replace settings-sidebar-billing-plans.png with octicon * Replace settings-sidebar-blocked-users.png with octicon * Version settings-sidebar-deploy-keys.png * Version reusable with settings-sidebar-emails.png * Replace settings-sidebar-interaction-limits.png with octicon * Replace settings-sidebar-organizations.png with octicon * Version use of settings-sidebar-repositories.png * Version reusable with settings-seidebar-security-analysis.png * Version reusable with settings-sidebar-ssh-keys.png * Version reusable with settings-sidebar-team-settings.png * Replace settings-sidebar-third-party-access.png with octicon * Version reusable with settings-user-orgs.png * Replace user-settings-pages.png with octicon * Update pages octicon * Add explicit versions to elsif tags * Rewording for consistency * Improve versioning for future GHAE * Add missing space Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com> * update search indexes * New translation batch for es (#25035) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=es * run script/i18n/reset-known-broken-translation-files.js * Check in es CSV report * Remove duplicated word (#24974) * Fix when we show the 'All Enterprise Releases' link (#25002) * Enterprise versions start with 'enterprise-server' * Show only if all versions are ghes versions * Show link if there's any ghes versioning * Depend on the path for the tool switcher (#25018) * Azure: use shared env setter, fix comment workflow (#25044) * update azure deployments to use shared env getter, fix content changes table * update search indexes * update search indexes * Update workflow-syntax-for-github-actions.md * New translation batch for pt (#25050) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt * run script/i18n/reset-known-broken-translation-files.js * update search indexes * The missing full stop was added. * update search indexes * update search indexes * New translation batch for pt (#25057) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt * run script/i18n/reset-known-broken-translation-files.js * New translation batch for es (#25058) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=es * run script/i18n/reset-known-broken-translation-files.js * update search indexes * update search indexes * Update OpenAPI Descriptions (#25047) * update search indexes * Enterprise bug fixes: week of Jan 31, 2022 (#25043) * delete the workflow linter (#25075) * an empty 'product', 'permissions', or 'learningTracks' gets stuck (#25070) * and empty 'this.product' gets stuck * add test to prove change * Update OpenAPI Descriptions (#25071) * Update OpenAPI Descriptions (#25076) * Update OpenAPI Descriptions * Add decorated OpenAPI schema files Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com> * basic tests of the search API (#25069) * basic tests of the search API * lfs * Revert "Revert Add apps permissions for code scanning org endpoint (#25023)" (#25026) * update website-scraper to update transitive nth-check dep (#25080) * update search indexes * New translation batch for es (#25088) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=es * run script/i18n/reset-known-broken-translation-files.js * Update code-scanning-alert.png (#25072) * use manual surrogate key for nextjs static assets (#25096) * use manual surrogate key for nextjs static assets * refactor * update search indexes * Update differences-between-clustering-and-high-availability-ha.md (#25107) * Update OpenAPI Descriptions (#25104) * Add versioning for GHAE 3.3 (#24936) * Update content/code-security/getting-started/github-security-features.md * update search indexes * [Actions] `push` event does not have Activity types (#15124) * 📝 Clarify usage of single quotes in string datatype for literals (#14895) * Fix value of GITHUB_REF for release events (#14876) * New translation batch for pt (#25084) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/fix-translation-errors.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=pt * run script/i18n/reset-known-broken-translation-files.js Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> * New translation batch for ja (#25093) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/lint-translation-files.js --check parsing * run script/i18n/reset-files-with-broken-liquid-tags.js --language=ja * run script/i18n/reset-known-broken-translation-files.js * Check in ja CSV report Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> * New translation batch for cn (#25090) * Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/lint-translation-files.js --check parsing * Run script/i18n/lint-translation-files.js --check rendering * run script/i18n/reset-files-with-broken-liquid-tags.js --language=cn * run script/i18n/reset-known-broken-translation-files.js * Check in cn CSV report Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> * Create github-debian.sh * Update Dockerfile * Update procedures for personal account recovery with two-factor authentication (#25040) * delete old deploy.js script (#24862) Co-authored-by: Mark Battistella <markbattistella@users.noreply.github.com> Co-authored-by: Emily Grace Seville <emilyseville7cf@gmail.com> Co-authored-by: Octomerger Bot <63058869+Octomerger@users.noreply.github.com> Co-authored-by: Anders Starcke Henriksen <starcke@github.com> Co-authored-by: Peter Bengtsson <mail@peterbe.com> Co-authored-by: Laura Coursen <lecoursen@github.com> Co-authored-by: lucie-docs <40564413+lucie-docs@users.noreply.github.com> Co-authored-by: Josh Johanning <joshjohanning@github.com> Co-authored-by: Tahlia G <84726379+tahlialouisa@users.noreply.github.com> Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: GitHub Actions <action@github.com> Co-authored-by: docubot <67483024+docubot@users.noreply.github.com> Co-authored-by: Simon Giesemann <kwacky1@github.com> Co-authored-by: Robert Sese <rsese@github.com> Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> Co-authored-by: Albin PK <56157868+albinpk@users.noreply.github.com> Co-authored-by: Dasun Tharanga <dasuntharangaflash@gmail.com> Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com> Co-authored-by: Ramya Parimi <33761166+ramyaparimi@users.noreply.github.com> Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com> Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com> Co-authored-by: Dorothy Mitchell <dorothymitchell@github.com> Co-authored-by: Andy J <mumfy@github.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> Co-authored-by: Marko Kaznovac <kaznovac@users.noreply.github.com> Co-authored-by: Anil Seervi <61609033+AnilSeervi@users.noreply.github.com> Co-authored-by: Johanan Idicula <johanan@forcepush.tech> * Add more screenshots * complete items on plan * Revert changes to files I didn't change * Minor tweaks * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Remove detail about building prebuilds by rerunning a workflow After deleting a prebuild configuration anyone who can access the workflow history can recreate the prebuilds by rerunning the previous workflow run - unless you go through manually deleting all of those entries from the workflow history. Removed this information as per review comment. * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/customizing-your-codespace/prebuilding-codespaces-for-your-project.md * Update data/reusables/codespaces/billing-for-prebuilds.md * Update data/reusables/codespaces/billing-for-prebuilds.md * Restructure info into separate articles * Update content/codespaces/prebuilding-your-codespaces/about-codespaces-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Move prerequisites section * Move billing info * Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Update data/reusables/codespaces/billing-for-prebuilds.md * Update data/reusables/codespaces/billing-for-prebuilds.md Co-authored-by: Laura Coursen <lecoursen@github.com> * Move deletion points, as per review comment * Update link * Add links to new information * Make review comment changes * Update content/codespaces/prebuilding-your-codespaces/managing-prebuilds.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Update content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md * Update content/codespaces/prebuilding-your-codespaces/testing-dev-container-changes.md Co-authored-by: Jackie Jiménez <jaclynj@github.com> * Optimize images Co-authored-by: Mark Battistella <markbattistella@users.noreply.github.com> Co-authored-by: Emily Grace Seville <emilyseville7cf@gmail.com> Co-authored-by: Octomerger Bot <63058869+Octomerger@users.noreply.github.com> Co-authored-by: Anders Starcke Henriksen <starcke@github.com> Co-authored-by: Peter Bengtsson <mail@peterbe.com> Co-authored-by: Laura Coursen <lecoursen@github.com> Co-authored-by: lucie-docs <40564413+lucie-docs@users.noreply.github.com> Co-authored-by: Josh Johanning <joshjohanning@github.com> Co-authored-by: Tahlia G <84726379+tahlialouisa@users.noreply.github.com> Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Co-authored-by: Felicity Chapman <felicitymay@github.com> Co-authored-by: GitHub Actions <action@github.com> Co-authored-by: docubot <67483024+docubot@users.noreply.github.com> Co-authored-by: Simon Giesemann <kwacky1@github.com> Co-authored-by: Robert Sese <rsese@github.com> Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> Co-authored-by: Albin PK <56157868+albinpk@users.noreply.github.com> Co-authored-by: Dasun Tharanga <dasuntharangaflash@gmail.com> Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com> Co-authored-by: Ramya Parimi <33761166+ramyaparimi@users.noreply.github.com> Co-authored-by: github-openapi-bot <github-openapi-bot@users.noreply.github.com> Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com> Co-authored-by: Dorothy Mitchell <dorothymitchell@github.com> Co-authored-by: Andy J <mumfy@github.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> Co-authored-by: Marko Kaznovac <kaznovac@users.noreply.github.com> Co-authored-by: Anil Seervi <61609033+AnilSeervi@users.noreply.github.com> Co-authored-by: Johanan Idicula <johanan@forcepush.tech> Co-authored-by: Jackie Jiménez <jaclynj@github.com> Co-authored-by: github-actions <github-actions@github.com>
11 KiB
title, intro, allowTitleToDifferFromFilename, permissions, redirect_from, versions, type, topics, product
| title | intro | allowTitleToDifferFromFilename | permissions | redirect_from | versions | type | topics | product | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Introduction to dev containers | You can use a `devcontainer.json` file to define a {% data variables.product.prodname_codespaces %} environment for your repository. | true | People with write permissions to a repository can create or edit the codespace configuration. |
|
|
how_to |
|
{% data reusables.gated-features.codespaces %} |
About dev containers
A development container, or dev container, is the environment that {% data variables.product.prodname_codespaces %} uses to provide the tools and runtimes that your project needs for development. If your project does not already have a dev container defined, {% data variables.product.prodname_codespaces %} will use the default configuration, which contains many of the common tools that your team might need for development with your project. For more information, see "Using the default configuration."
If you want all users of your project to have a consistent environment that is tailored to your project, you can add a dev container to your repository. You can use a predefined configuration to select a common configuration for various project types with the option to further customize your project or you can create your own custom configuration. For more information, see "Using a predefined container configuration" and "Creating a custom codespace configuration." The option you choose is dependent on the tools, runtimes, dependencies, and workflows that a user might need to be successful with your project.
{% data variables.product.prodname_codespaces %} allows for customization on a per-project and per-branch basis with a devcontainer.json file. This configuration file determines the environment of every new codespace anyone creates for your repository by defining a development container that can include frameworks, tools, extensions, and port forwarding. A Dockerfile can also be used alongside the devcontainer.json file in the .devcontainer folder to define everything required to create a container image.
devcontainer.json
{% data reusables.codespaces.devcontainer-location %}
You can use your devcontainer.json to set default settings for the entire codespace environment, including the editor, but you can also set editor-specific settings for individual workspaces in a codespace in a file named .vscode/settings.json.
For information about the settings and properties that you can set in a devcontainer.json, see devcontainer.json reference in the {% data variables.product.prodname_vscode %} documentation.
Dockerfile
A Dockerfile also lives in the .devcontainer folder.
You can add a Dockerfile to your project to define a container image and install software. In the Dockerfile, you can use FROM to specify the container image.
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-14
# ** [Optional] Uncomment this section to install additional packages. **
# USER root
#
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
#
# USER codespace
You can use the RUN instruction to install any software and && to join commands.
Reference your Dockerfile in your devcontainer.json file by using the dockerfile property.
{
...
"build": { "dockerfile": "Dockerfile" },
...
}
For more information on using a Dockerfile in a dev container, see Create a development container in the {% data variables.product.prodname_vscode %} documentation.
Using the default configuration
If you don't define a configuration in your repository, {% data variables.product.prodname_dotcom %} creates a codespace with a base Linux image. The base Linux image includes languages and runtimes like Python, Node.js, JavaScript, TypeScript, C++, Java, .NET, PHP, PowerShell, Go, Ruby, and Rust. It also includes other developer tools and utilities like git, GitHub CLI, yarn, openssh, and vim. To see all the languages, runtimes, and tools that are included use the devcontainer-info content-url command inside your codespace terminal and follow the url that the command outputs.
Alternatively, for more information about everything that is included in the base Linux image, see the latest file in the microsoft/vscode-dev-containers repository.
The default configuration is a good option if you're working on a small project that uses the languages and tools that {% data variables.product.prodname_codespaces %} provides.
Using a predefined container configuration
Predefined container definitions include a common configuration for a particular project type, and can help you quickly get started with a configuration that already has the appropriate container options, {% data variables.product.prodname_vscode %} settings, and {% data variables.product.prodname_vscode %} extensions that should be installed.
Using a predefined configuration is a great idea if you need some additional extensibility. You can also start with a predefined configuration and amend it as needed for your project's setup.
{% data reusables.codespaces.command-palette-container %}
- Click the definition you want to use.

- Follow the prompts to customize your definition. For more information on the options to customize your definition, see "Adding additional features to your
devcontainer.jsonfile." - Click OK.

- To apply the changes, in the bottom right corner of the screen, click Rebuild now. For more information about rebuilding your container, see "Applying changes to your configuration."

Adding additional features to your devcontainer.json file
{% note %}
Note: This feature is in beta and subject to change.
{% endnote %}
You can add features to your predefined container configuration to customize which tools are available and extend the functionality of your workspace without creating a custom codespace configuration. For example, you could use a predefined container configuration and add the {% data variables.product.prodname_cli %} as well. You can make these additional features available for your project by adding the features to your devcontainer.json file when you set up your container configuration.
You can add some of the most common features by selecting them when configuring your predefined container. For more information on the available features, see the script library in the vscode-dev-containers repository.
You can also add or remove features outside of the Add Development Container Configuration Files workflow.
- Access the Command Palette (
Shift + Command + P/Ctrl + Shift + P), then start typing "configure". Select Codespaces: Configure Devcontainer Features.
- Update your feature selections, then click OK.

- To apply the changes, in the bottom right corner of the screen, click Rebuild now. For more information about rebuilding your container, see "Applying changes to your configuration."

Creating a custom codespace configuration
If none of the predefined configurations meet your needs, you can create a custom configuration by adding a devcontainer.json file. {% data reusables.codespaces.devcontainer-location %}
In the file, you can use supported configuration keys to specify aspects of the codespace's environment, like which {% data variables.product.prodname_vscode %} extensions will be installed.
{% data reusables.codespaces.vscode-settings-order %}
You can define default editor settings for {% data variables.product.prodname_vscode %} in two places.
- Editor settings defined in
.vscode/settings.jsonare applied as Workspace-scoped settings in the codespace. - Editor settings defined in the
settingskey indevcontainer.jsonare applied as Remote [Codespaces]-scoped settings in the codespace.
After updating the devcontainer.json file, you can rebuild the container for your codespace to apply the changes. For more information, see "Applying changes to your configuration."
Applying changes to your configuration
{% data reusables.codespaces.apply-devcontainer-changes %}
{% data reusables.codespaces.rebuild-command %}
- {% data reusables.codespaces.recovery-mode %} Fix the errors in the configuration.
- To diagnose the error by reviewing the creation logs, click View creation log.
- To fix the errors identified in the logs, update your
devcontainer.jsonfile. - To apply the changes, rebuild your container.