Overview
Each codespace that you create is hosted on a separate virtual machine. When you create a codespace from a repository, you can usually choose from different types of virtual machines. Each machine type has different resources (processor cores, memory, storage) and, by default, the machine type with the least resources is used. For more information, see "Changing the machine type for your codespace."
If your project needs a certain level of compute power, you can configure GitHub Codespaces so that only machine types that meet these requirements can be used by default, or selected by users. You configure this in a devcontainer.json file.
게시되지 않은 codespace(GitHub의 리포지토리에 연결되지 않은 템플릿에서 만든 codespaces)는 항상 동일한 사양의 가상 머신에서 실행됩니다. 게시되지 않은 codespace의 컴퓨터 형식은 변경할 수 없습니다.
Important: Access to some machine types may be restricted at the organization level. Typically this is done to prevent people choosing higher resourced machines that are billed at a higher rate. If your repository is affected by an organization-level policy for machine types you should make sure you don't set a minimum specification that would leave no available machine types for people to choose. For more information, see "Restricting access to machine types."
Setting a minimum machine specification
-
리포지토리에 대한 GitHub Codespaces은(는) 파일에서
devcontainer.json구성할 수 있습니다. 리포지토리에 파일이 아직 없는devcontainer.json경우 지금 파일을 추가할 수 있습니다. "리포지토리에 개발 컨테이너 구성 추가"를 참조하세요. -
Edit the
devcontainer.jsonfile, adding thehostRequirementsproperty at the top level of the file, within the enclosing JSON object. For example:JSON "hostRequirements": { "cpus": 8, "memory": "8gb", "storage": "32gb" }You can specify any or all of the options:
cpus,memory, andstorage.To check the specifications of the GitHub Codespaces machine types that are currently available for your repository, step through the process of creating a codespace until you see the choice of machine types. For more information, see "Creating a codespace for a repository."
-
Save the file and commit your changes to the required branch of the repository.
Now when you create a codespace for that branch of the repository, and you go to the creation configuration options, you will only be able to select machine types that match or exceed the resources you've specified.
