Files

2.5 KiB

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.