update readme file with notes on building docker images

This commit is contained in:
2024-03-10 14:59:39 -07:00
parent 63ba4d29c8
commit 2ffc3c408a
+47
View File
@@ -14,6 +14,13 @@ Options that can be overridden are:
- `PACKAGE_NAME`: base name of the output package. (default: `streamline-emr`) - `PACKAGE_NAME`: base name of the output package. (default: `streamline-emr`)
- `OUTPUT_DIR`: directory where packages will be stored. (default: `$PROJECT_ROOT/build-packages`) - `OUTPUT_DIR`: directory where packages will be stored. (default: `$PROJECT_ROOT/build-packages`)
- `PACKAGE_IMAGES`: if set to a value other than 1, do NOT package images. (default: `1`) - `PACKAGE_IMAGES`: if set to a value other than 1, do NOT package images. (default: `1`)
- `IMAGE_TAG`: if set, used to specify a source image tag. (default: uses git-based version name)
- `IMAGES_LIST`: if set, specifies an alternate image list file. (default: `$PROJECT_ROOT/images.csv`)
For example, to build using the absolute latest images available:
```bash
IMAGE_TAG=latest package.sh
```
## Installing ## Installing
1. extract the generated archive file in a temporary folder on the target system 1. extract the generated archive file in a temporary folder on the target system
@@ -80,3 +87,43 @@ Several scripts are used to manage app instances, including:
`start`: loads configuration details from `instances.conf`, then configures and starts each application instance in a dedicated subfolder `start`: loads configuration details from `instances.conf`, then configures and starts each application instance in a dedicated subfolder
`stop`: locates and stops all instances, even if no longer defined in `instances.conf` `stop`: locates and stops all instances, even if no longer defined in `instances.conf`
`monitor`: checks the status of each instance service and sends data to `bgsystemlog` if possible (loc: `streamline_emr`) `monitor`: checks the status of each instance service and sends data to `bgsystemlog` if possible (loc: `streamline_emr`)
## Docker Images
We want to use our own copy of the Docker images hosted on our GitLab Registry. The `docker` folder contains a set of Dockerfiles that should be used for generating images.
### Automated
The script `build-image` can be used to automatically build, tag, and push images with standard naming conventions. To build and push all images, simple run `build-image -p`. To simply build images and skip pushing to a registry, omit the `-p` flag.
Building for another platform (e.g. building arm64 from amd64 host) may fail if the Dockerfile requires running certain commands. To build only specific images, dockerfiles may be specified with `build-image -f <DOCKERFILE> [ -f <DOCKERFILE> ... ]`
Other options can be specified to override the image name or version. See the help menu for full details: `build-image -h`
### Manual
1. Make sure you are logged in to the Signalytic GitLab Registry:
```bash
# Login to the registry
docker login registry.gitlab.com
```
2. Build an image (note: we're using platforms `linux/amd64` and `linux/arm64`)
```bash
# Build an image
docker build -f ${DOCKERFILE} --platform ${PLATFORM} -t ${IMAGE_TAG} .
```
3. Make a copy of an existing image:
```bash
# Create a tag
docker tag ${IMAGE_ID} registry.gitlab.com/signalytic/client-external/streamline/streamline-emr/${NAME}:${TAG}
```
3. Push the image to our GitLab Registry:
```bash
# Push the image
docker push registry.gitlab.com/signalytic/client-external/streamline/streamline-emr/${NAME}:${TAG}
```