Skip to content

Commit

Permalink
Merge pull request #1757 from nicomiguelino/df-only-cli
Browse files Browse the repository at this point in the history
Add support for generating only Dockerfiles when running `bin/build_containers.sh`.
  • Loading branch information
nicomiguelino authored Feb 28, 2023
2 parents 8d21d2b + cb7e1ff commit 508a7b7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` before you do 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.
Expand Down
5 changes: 5 additions & 0 deletions bin/build_containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 508a7b7

Please sign in to comment.