Files
spark/docker/sparkd/dev/README.md
T
John Colvin b42943fe8d chore: Rename Docker image 'spark-dev' -> 'sparkd-dev'
This is a more accurate and appropriate name than 'spark-dev' because
the image is designed to build/run Sparkd and the Spark Api Server (both
of which are daemons, hence the appropriateness of the 'd' suffix). It
isn't designed to build/run the front-end desktop application, Spark.
2023-04-03 10:28:51 -04:00

52 lines
1.9 KiB
Markdown

# Sparkd Dev Container
## How to create a Sparkd VS Code Devcontainer
1. Make sure the "Dev Containers" extension is installed in VS Code
1. Make sure your Docker image is up to date
```
docker pull johncolvin/bluetradingsystems:sparkd-dev
```
1. Copy **devcontainer.json** from this folder to **$workspaceFolder/.devcontainer/**.
```
# This assumes the 'workspaceFolder' is the repo root.
# If this is not the case, set "workspaceFolder" to the correct path
# Determine repo root (only works if you are in a dir inside the repo!)
repoRoot="$(git rev-parse --show-toplevel)"
workspaceFolder="$repoRoot"
devcontainerFolder="$repoRoot/devcontainer/"
mkdir -p "$devcontainerFolder"
cp "$repoRoot/devcontainer.json "$devcontainerFolder"
```
1. In the VS Code Command Palette, run **Dev Containers: Reopen in Container**
---
## 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
```
./build.sh --image johncolvin/bluetradingsystems:sparkd-dev
```
> - ***NOTE:** The convention in Docker repos is to format image tags
> `<user>/<repo>:<image_name>` (hence the 'johncolvin' in the tag)*<br>
> - ***TODO (maybe):** Push images with a common username, like 'bts'. For
> now, we'll just use 'johncolvin' because I happened to push the first
> image, and did so with a conventional tag.*
1. Commit the changes to Dockerfile in git
1. Push the new image to Docker Hub
```
docker push johncolvin/bluetradingsystems:sparkd-dev
```
***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.*