From ee82e28fbcbaaf766b23fe91f4489b3b03d42f4f Mon Sep 17 00:00:00 2001 From: nicomiguelino Date: Mon, 27 Feb 2023 11:50:32 -0800 Subject: [PATCH 1/2] Add support for generating only Dockerfiles. --- README.md | 27 +++++++++++++++++++++++++++ bin/build_containers.sh | 5 +++++ 2 files changed, 32 insertions(+) diff --git a/README.md b/README.md index 4d8a3f5d9..b20234919 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,33 @@ $ docker-compose \ -f docker-compose.dev.yml up ``` +## Building Containers Locally + +Make sure that you have `buildx` installed and that you have run +`docker buildx create --use` befure you run the following: + +```bash +./bin/build_containers.sh +``` + +### Skipping Specific Services + +Say that you would like to skip building the `anthias-viewer` and `anthias-nginx` +services. Just run the following: + +```bash +SKIP_VIEWER=1 SKIP_NGINX=1 ./bin/build_containers.sh +``` + +### Generating Only Dockerfiles + +If you'd like to just generate the Dockerfiles from the templates provided +inside the `docker/` directory, run the following: + +```bash +DOCKERFILES_ONLY=1 ./bin_build_containers.sh +``` + ## Running the Unit Tests Start the containers. diff --git a/bin/build_containers.sh b/bin/build_containers.sh index def6297ee..872099f4b 100755 --- a/bin/build_containers.sh +++ b/bin/build_containers.sh @@ -101,6 +101,11 @@ for container in ${SERVICES[@]}; do cat "docker/Dockerfile.$container.tmpl" | envsubst > "docker/Dockerfile.$container" fi + if [[ -n "${DOCKERFILES_ONLY:-}" ]] && [[ "${DOCKERFILES_ONLY}" -ne 0 ]]; then + echo "Variable DOCKERFILES_ONLY is set. Skipping build for $container..." + continue + fi + # If we're running on x86, remove all Pi specific packages if [ "$BOARD" == 'x86' ]; then if [[ $OSTYPE == 'darwin'* ]]; then From cb7e1ff02bc3b894e05b885414766067220777eb Mon Sep 17 00:00:00 2001 From: nicomiguelino Date: Tue, 28 Feb 2023 09:33:07 -0800 Subject: [PATCH 2/2] Add minor changes to README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b20234919..5fcba7964 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ $ docker-compose \ ## Building Containers Locally Make sure that you have `buildx` installed and that you have run -`docker buildx create --use` befure you run the following: +`docker buildx create --use` before you do the following: ```bash ./bin/build_containers.sh