65 lines
2.5 KiB
Markdown
65 lines
2.5 KiB
Markdown
[dev containers]: https://code.visualstudio.com/docs/devcontainers/containers
|
|
[dev containers ext]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
|
|
[docker repo sparkd-dev]: https://hub.docker.com/repository/docker/bluetradingsystems/sparkd-dev/general
|
|
# Sparkd Dev Container
|
|
## How to create a VS Code [Dev Container][dev containers]
|
|
|
|
1. Make sure the **[Dev Containers][dev containers ext]** extension is installed
|
|
1. Make sure your Docker image is up to date
|
|
```
|
|
docker pull bluetradingsystems/sparkd-dev:latest
|
|
```
|
|
1. Copy **devcontainer.json** from this folder to **$workspaceFolder/.devcontainer/**.
|
|
|
|
1. In the VS Code Command Palette, run **Dev Containers: Reopen in Container**
|
|
|
|
---
|
|
## How to create a Sparkd Container in the terminal (without VS Code)
|
|
|
|
1. Make sure your Docker image is up to date
|
|
```
|
|
docker pull bluetradingsystems/sparkd-dev:latest
|
|
```
|
|
2. Start the container
|
|
```
|
|
# Replace <cont_name> with a name for the container. The container's
|
|
# "$HOME" dir will be mounted to "$HOME/.sparkd-dev/mounts/<cont_name> on
|
|
# the host
|
|
|
|
./start_docker.sh --container <cont_name> --mount-existing
|
|
```
|
|
* *Replace <cont_name> with a name for the container*
|
|
* *The container's `$HOME` dir will be mounted to
|
|
`$HOME/.sparkd-dev/mounts<cont_name>` on the host*<br>
|
|
* *Run: `./start_docker.sh --help` to see additional options*
|
|
3. *(Optional) Attach VS Code to the running container.*<br>
|
|
Run **Dev Containers: Attach to Running Container** from the command palette,
|
|
then select your container in the dropdown
|
|
|
|
---
|
|
## How to update the Docker image
|
|
|
|
1. Change the image by modifying the Dockerfile (don't tag arbitrary
|
|
images on your machine and push them to our repo on Docker Hub)
|
|
|
|
1. After modifying the Dockerfile, (re)build the image
|
|
```
|
|
# Run in this dir
|
|
docker build -t bluetradingsystems/sparkd-dev:latest .
|
|
```
|
|
***Note:** Your docker login must have write permissions to push to the
|
|
[sparkd-dev][docker repo sparkd-dev] repository*
|
|
|
|
2. Commit the changes to Dockerfile in git
|
|
|
|
3. Push the new image to Docker Hub
|
|
|
|
```
|
|
docker push bluetradingsystems/sparkd-dev:latest
|
|
```
|
|
***Note:** The image doesn't have to be on Docker Hub, we can simply build
|
|
it from scratch on our local machines (with the Dockerfile). However, this
|
|
takes time. It is significantly quicker to download a prebuilt image, so we
|
|
store it on a remote repository to save time when setting up a new dev
|
|
machine.*
|