This repository is meant to provide a minimal example for troubleshooting issues when trying to use GitHub Codespaces.
This repository was created to support the bug-report and discussion here.
Briefly, Codespaces successfully builds a codespace if the devcontainer.json
instructs to build from a Dockerfile
. However, if the devcontainer.json
instructs to use a docker-compose.yml
, Codespaces will not build even if that docker-compose.yml
file is using the same exact Dockerfile
.
main
: This branch contains a minimal example of a Codespaces configuration that works (i.e., does not usedocker-compose.yml
).broken
: This branch contains a minimal example of a Codespaces configuration that does not work (i.e., usesdocker-compose.yml
).fixed
: This branch fixed the issue by updating the version specified indocker-compose.yml
as tipped by the GitHub codespaces team here
Before doing any of the steps below, clone this repository.
- On the
main
branch, open a VS Code Remote Containers session. - From a terminal in the VS Code Remote Containers session, run
Rscript hello.R
- On the
main
branch, open the repository in GitHub Codespaces in a browser. - From the terminal in the browser session, run
Rscript hello.R
- On the
broken
branch, open a VS Code Remote Containers session. - From a terminal in the VS Code Remote Containers session, run
Rscript hello.R
- After having built the image locally in the previous steps, from any terminal session run
docker run --rm -i gh_codespace_troubleshooting-app
- On the
broken
branch, open the repository in GitHub Codespaces in a browser. - Observe that the Codespace is not created, and a recovery container is created instead.
- Retrieve the logs from the Codespace-creation process:
Failed to create container.
Error: Command failed: docker-compose -f /var/lib/docker/codespacemount/workspace/gh_codespace_troubleshooting/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml config
Error Code: 1302
Container creation failed.