Setup Development Environment
We use Visual Studio Code with the Remote - Containers extension. This lets you use a Docker container as a full-featured development environment. A devcontainer.json file in Core tells VS Code how to access (or create) a development container with a well-defined tool and runtime stack.
To get started try the following:
- Install Visual Studio Code
- Install Docker Desktop
- Start Docker Desktop
- PC users: Windows limits resources to WSL 2 (Memory/CPU), this limit can be configured in your .wslconfig file.
- Start VS Code and add Dev Containers Extension
- Run
Dev-Containers: Clone Repository in Container Volume...
from the Command Palette (F1). - Pick GitHub (You'll need to authenticate with GitHub), then enter
JesusFilm/core
, finally choose themain
branch to clone. - The VS Code window (instance) will reload, clone the source code, and start building the dev container. A progress notification provides status updates.
- After the build completes, VS Code will automatically connect to the container. You can now work with the repository source code in this independent environment as you would if you had cloned the code locally.
Common Issues
VS Code fails to build container on Mac
docker-compose version --short
fork/exec /usr/local/bin/docker-compose-v1: bad CPU type in executable
- Open Docker Desktop
- Go to Settings -> General, and scroll down to the bottom
- Tick 'Use Docker Compose V2'
- Click 'Apply & Restart'
- Go to VS code and run 'Rebuild Container'. The container should now build successfully
Container is running slowly or crashing on Mac
- Open Docker Desktop
- Go to Settings -> Resources -> Advanced
- Set CPUs: 7, Memory: 12.00GB, Swap: 4GB
- Click 'Apply & Restart'
"Docker not found" or "Docker daemon not started" when starting VSCode after updating docker
- Open Docker Desktop
- Go to Settings -> Advanced and ensure the following settings are selected:
- System (requires password)
- Allow the default Docker socket to be used (requires password)
- Allow privileged port mapping (requires password)
- Automatically check configuration