Set Up Dev Container
You can set up a VS Code Dev Container environment as follows.
For more detailed support, please refer to VS Code Dev Containers documentation.
Hardware use This Dev Container setup targets development and the emulator. To run XCENA hardware inside the Dev Container, the container must connect to the host
pxl_resourceddaemon - add the daemon options torunArgsin.devcontainer/devcontainer.json, for example:"runArgs": [ "--privileged", "--pid=host", "--ipc=host", "--cgroupns=host", "-v", "/run/pxl:/run/pxl", "-v", "/tmp/pxl:/tmp/pxl", "-v", "/dev:/dev", "-v", "/sys:/sys" ]See Host Daemon Setup for the full option list and prerequisites (host
pxl_resourced, libpxl 1.4.9+).
Requirements
- Prebuilt Docker Image
- VS Code
- VS Code Extension : Dev Containers
Setup example
-
Create a Workspace
mkdir workspaceYou can use a different name for the workspace if preferred.
- Environment setup
-
Create a temporary container and copy necessary files to your workspace
docker create --name temp_container xcenadev/sdk:latest cd workspace docker cp temp_container:/work/. .Dev Container configuration and SDK files will be copied from the temporary container to your workspace.
-
Ensure the Dev Container image tag matches the copied SDK
Open
.devcontainer/devcontainer.jsonin the copied files and set the image tag to the tag of the image you copied the files from:{ "name": "XCENA SDK container", // Use 'latest' by default. If you use a specific version, change the tag here. "image": "xcenadev/sdk:latest" // e.g., "image": "xcenadev/sdk:v1.5.0" } -
Remove the temporary container
docker rm temp_container
-
- Open Dev Container
-
Open the workspace in VS Code
-
Reopen in Dev Container Press
[CTRL + SHIFT + P]and selectDev Containers: Reopen in Container
-
Additional Notes
- Make sure you have the necessary permissions to access the prebuilt Docker image.
- If you encounter any issues, verify that the Docker daemon is running and the VS Code Dev Containers extension is properly installed.
- If you need to customize the Dev Container configuration further, you can modify the
.devcontainerfolder in your workspace.