Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Lab: Setup GitHub Codespace

GitHub Codespaces and this workshop repository

Step-by-Step Guide to Set Up GitHub Codespace from Browser

  • Log in to GitHub

  • Fork the repository

    Disclaimer: Training sessions may point at a different branch or fork. Always use the repository URL your instructor gives you. This guide uses the public workshop repo above.

    • In the top-right corner, click Fork and complete the fork flow. Wait until GitHub opens your fork.
  • Open your fork in a Codespace

    • Go to your fork of the repository (under your user or organisation).
    • Click the green Code button, then open the Codespaces tab.
    • Choose Create codespace on main (or the branch your instructor named).
  • Wait for initialization

    • GitHub builds a Linux development container. First start often takes one to two minutes.
    • When the editor loads, you get a VS Code style environment in the browser with an integrated terminal.
  • Configure your environment

    • After the shell prompt appears in the Codespace, run the commands in the next section once.

Terminal setup

  • Run these in the Codespace integrated terminal (the terminal inside the browser editor). This is still the Linux environment GitHub created for you, not a separate SSH box.

Docker

docker version
docker compose version
  • Workspace and hello-world
mkdir -p ~/peachycloudsecurity-lab-workspace && cd ~/peachycloudsecurity-lab-workspace
docker run --rm hello-world

You should see the hello-world completion text. That only checks that Docker can pull and run an image from this Codespace.

  • Cleanup
docker rmi hello-world

Troubleshooting

  • Slow or stuck build: stop the Codespace from GitHub Codespaces and start again on the right branch if your instructor agrees.
  • Docker not responding: sudo dockerd &, wait a few seconds, then docker version again.

Next step: Lab: Workshop workspace