2020-12-08 06:24:46 +00:00
# Development container
Development container that can be used with VSCode.
2024-10-10 08:33:33 +00:00
It works on Linux, Windows (WSL2) and OSX.
2020-12-08 06:24:46 +00:00
## Requirements
- [VS code ](https://code.visualstudio.com/download ) installed
2024-10-10 08:33:33 +00:00
- [VS code dev containers extension ](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers ) installed
2020-12-08 06:24:46 +00:00
- [Docker ](https://www.docker.com/products/docker-desktop ) installed and running
## Setup
2023-05-29 15:57:09 +00:00
1. Create the following files on your host if you don't have them:
```sh
touch ~/.gitconfig ~/.zsh_history
```
2024-10-10 08:33:33 +00:00
1. **For OSX hosts ** : ensure your home directory `~` is accessible by Docker.
2020-12-08 06:24:46 +00:00
1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P).
2024-10-10 08:33:33 +00:00
1. Select `Dev-Containers: Open Folder in Container...` and choose the project directory.
2020-12-08 06:24:46 +00:00
## Customization
2024-10-10 08:33:33 +00:00
For customizations to take effect, you should "rebuild and reopen":
2020-12-08 06:24:46 +00:00
2024-10-10 08:33:33 +00:00
1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P)
2. Select `Dev-Containers: Rebuild Container`
2020-12-08 06:24:46 +00:00
2024-10-10 08:33:33 +00:00
Customizations available are notably:
2020-12-08 06:24:46 +00:00
2024-10-10 08:33:33 +00:00
- Changes to the Docker image in [Dockerfile ](Dockerfile )
- Changes to VSCode **settings ** and **extensions ** in [devcontainer.json ](devcontainer.json ).
2024-10-10 08:34:56 +00:00
- Change the entrypoint script by adding in [devcontainer.json ](devcontainer.json ) a bind mount to a shell script to `/root/.welcome.sh` to replace the [current welcome script ](https://github.com/qdm12/godevcontainer/blob/master/shell/.welcome.sh ). For example:
```json
{
"source": "/yourpath/.welcome.sh",
"target": "/root/.welcome.sh",
"type": "bind"
},
2020-12-08 06:24:46 +00:00
```
2024-10-10 08:33:33 +00:00
- More customizations available are documented in the [devcontainer.json reference ](https://containers.dev/implementors/json_reference/ ).