diff options
author | Chiyuan Zhang <pluskid@gmail.com> | 2020-11-06 19:05:31 -0800 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-11-16 22:49:20 -0500 |
commit | 9388b24e7a9ad2b6b4f3e66647c5278bf37de8b8 (patch) | |
tree | 52ddda9242e723d95b707cadc393052303456007 | |
parent | 28a4f33ee728e4144f00daed8b771f7b2d7d0e13 (diff) |
zmk-config mounting based on docker volume
-rw-r--r-- | .devcontainer/devcontainer.json | 5 | ||||
-rw-r--r-- | docs/docs/dev-build-flash.md | 17 |
2 files changed, 21 insertions, 1 deletions
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 14feeff..0de8bcf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,6 +6,9 @@ "containerEnv": {"WORKSPACE_DIR": "${containerWorkspaceFolder}"}, "settings": { "terminal.integrated.shell.linux": "/bin/bash" - }, + }, + "mounts": [ + "type=volume,source=zmk-config,target=/workspaces/zmk-config" + ] } diff --git a/docs/docs/dev-build-flash.md b/docs/docs/dev-build-flash.md index bfdd464..304ea32 100644 --- a/docs/docs/dev-build-flash.md +++ b/docs/docs/dev-build-flash.md @@ -99,6 +99,23 @@ For instance, building kyria firmware from a user `myUser`'s `zmk-config` folder west build -b nice_nano -- -DSHIELD=kyria_left -DZMK_CONFIG="C:/Users/myUser/Documents/Github/zmk-config/config" ``` +In order to make your `zmk-config` folder available when building within the VSCode Remote Container, you need to create a docker volume named `zmk-config` +by binding it to the full path of your config directory. If you have run the VSCode Remote Container before, it is likely that docker has created this +volume automatically -- we need to delete the default volume before binding it to the correct path. Follow the following steps: + +1. Stop the container by exiting VSCode. You can verify no container is running via the command `docker ps`. +1. Remove all the containers that are not running via the command `docker container prune`. We need to remove the ZMK container before we can delete the default `zmk-config` volume referenced by it. If you do not want to delete all the containers that are not running, you can find the id of the ZMK container and use `docker rm` to delete that one only. +1. Remove the default volume via the command `docker volume rm zmk-config`. + +Then you can bind the `zmk-config` volume to the correct path pointing to your local [zmk-config](./customization.md) folder: + +``` +docker volume create --driver local -o o=bind -o type=none -o \ + device="/full/path/to/your/zmk-config/" zmk-config +``` + +Now start VSCode and rebuild the container after being prompted. You should be able to see your zmk-config mounted to `/workspaces/zmk-config` inside the container. So you can build your custom firmware with `-DZMK_CONFIG="/workspaces/zmk-config/config"`. + ## Flashing Once built, the previously supplied parameters will be remembered so you can run the following to flash your |