Files
spark/docker/sparkd/dev
John Colvin 0266d09e20 docker: Update and clean up Dockerfile
* Upgrade dotnet 7 -> 8
* Upgrade clang (13, 15) -> 17
* Upgrade gcc (11, 12) -> 13
* Remove kitware release candidate apt repo (probably shouldn't have
  been added in the first place).
* Install gdb for c++ debugging (VS Code debugger depends on this)
* Use explicit release ubuntu:22.04 (not 'latest'). We don't want the
  distro to automatically upgrade one day, when 'latest' suddenly points
  to a new release. Upgrades like that need to be done deliberately.
* Use more granular RUN cmds to reduce rebuild times.

  When a Dockerfile is built, the RUN cmds are executed in the order
  in which they were written (duh!). Checkpoints called "cache layers"
  are saved for each RUN cmd, so if the Dockerfile is later modified,
  the image can be rebuilt from the most recent layer that wasn't
  invalidated by the modifications.
2024-03-13 13:43:31 -05:00
..
2023-09-29 13:10:50 -04:00

Sparkd Dev Container

How to create a VS Code Dev Container

  1. Make sure the Dev Containers extension is installed

  2. Make sure your Docker image is up to date

    docker pull bluetradingsystems/sparkd-dev:latest
    
  3. Copy devcontainer.json from this folder to $workspaceFolder/.devcontainer/.

  4. 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
    • Run: ./start_docker.sh --help to see additional options
  3. (Optional) Attach VS Code to the running container.
    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)

  2. 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 repository

  3. Commit the changes to Dockerfile in git

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