From 7a1d822b7009c1f13bb76b0d521704e300650737 Mon Sep 17 00:00:00 2001 From: andy5995 Date: Mon, 2 Dec 2024 03:24:46 -0600 Subject: [PATCH] Update docs --- docker/README.md | 51 ++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/docker/README.md b/docker/README.md index f0dde863..59b0a2e9 100644 --- a/docker/README.md +++ b/docker/README.md @@ -6,44 +6,37 @@ You may build your changes by using the compose file. First create an `.env` file in /docker. The contents should be similar to that of `.env.example`: ```text -HOSTUID=1000 -HOSTGID=1000 -IMAGE="ghcr.io/karurochori/vs-fltk:build-env" -ENTRYPOINT:$PWD/docker/default-entry.sh -SOURCE_ROOT=$PWD +# Add your numeric user and group id +HOSTUID= +HOSTGID= + +# The directory in the container where the source root will be mounted +WORKSPACE="/vs-workspace" ``` Replace the values for `HOSTUID` and `HOSTGID` with your system `uid` and `gid`. -Then, from the source root: +Then, from the source root, to enter the build environment: ```sh docker-compose -f docker/docker-compose.yml run --rm dev ``` -This will start the container and build the app. +From there, you can run the commands to build the app. You can use your +regular IDE to make changes, and then test them by building within the +container. -To enter the build environment without actually building the app: +To start the container and build the app non-interactively: ```sh -export ENTRYPOINT=$PWD/docker/shell-entry.sh -docker-compose -f docker/docker-compose.yml run --rm dev +export ENTRYPOINT=/entry-build.sh ``` -Remember to unset `ENTRYPOINT` when you wish to use the default again. +And use the same command as shown above. - +Remember to unset `ENTRYPOINT` when you wish to start the container with only +a prompt. -All of the above methods will mount your current directory as _/workspace_ +All of the above methods will mount your current directory as _/vs-workspace_ inside the container. Your username will be _builder_. By default, you will not have root privileges (which are not necessary to build and test). However, you can use `sudo` if you need to run `apt` or any other commands that require @@ -51,6 +44,18 @@ root access. ## Notes +### Changing the default environmental variables + +If you wish to change some values or variables, you should not need to edit +`docker-compose.yml`. You can add variables used in the compose file to your +`.env' file or pass them on the command line at runtime. See [Environment +variables in +Compose](https://docs.docker.com/compose/how-tos/environment-variables/) for +more information. And of course, open an issue if you have suggestions for +improvements. + +### Working with Containers + In the examples above, we've included `--rm` as an argument. This normally removes the container after it's exited. `docker ps -a` displays containers that still exist, so you may periodically want to make sure you don't have