Files
spark/docker/sparkd/dev
John Colvin 6c2bfee616 fix (docker): Set default user without specific group
Bugs (fixed):
  * The default user does not have sudo permission in the container,
    unless the user is specified explicitly in the 'docker exec' cmd
    (via -u <user>).

    Cause: When the default user is specified with a specific group
    (in this case, its namesake 'bts'), it is excluded from all other
    groups, including 'sudo'.
2023-04-03 11:43:37 -04:00
..

Sparkd Dev Container

How to create a Sparkd VS Code Devcontainer

  1. Make sure the "Dev Containers" extension is installed in VS Code

  2. Make sure your Docker image is up to date

    docker pull johncolvin/bluetradingsystems:sparkd-dev
    
  3. 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"
    
  4. 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)

  2. 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)
    • 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.
  3. Commit the changes to Dockerfile in git

  4. 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.