Speciftying a DevContainer in gem5 allows for users to quickly create an environment in which they can develop, build, and run gem5. The ".devcontainer/devcontainer.json" file specifies the properties of the container. In this commit they are as follows: 1. The Docker image ghcr.io/gem5/devcontainer. This is built from "util/dockerfiles/devcontainer". This Dockerfile provides all dependencies and a pre-built gem5 binary from the current main branch (added to "/usr/local/bin"). In order to support this Docker container on different platforms we use the Docker multi-platform feature. As such, this must be built using `docker buildx bake devcontainer --push` which reads the `docker-bake.hcl file for the specification of the multi-platform image. 2. Visual Studio extensions. This is a list of Visual Studio Code extensions useful when developing gem5. They are automatically added the Visual Studio dev container. 3. Features. Features are enhancemets that can be added to a DevContainer. Normally they are libraries and other commonly used tools to be included in the Container. As we have our dependencies specified in the Dockerfile here we select one to enable Docker inside the container, one to enable the Github CLI, one to improve Linting, and finally one to enable the vscode CLI. 4. The On Create Command : This command allows us to specify commands to be run after the DevContainer is created. In this case we execute ".devcontainer/on-create.sh" which, right now, refreshes the git index and installed the pre-commit checks.
1.3 KiB
1.3 KiB