You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by nd...@apache.org on 2025/12/16 20:33:55 UTC
(tika) 03/04: TIKA-4578: Pass all environment variables from Maven to docker-build.sh
This is an automated email from the ASF dual-hosted git repository.
ndipiazza pushed a commit to branch TIKA-4578
in repository https://gitbox.apache.org/repos/asf/tika.git
commit ffbe00ac9221db9480e7c92d50ebf75286f5ee37
Author: Nicholas DiPiazza <nd...@apache.org>
AuthorDate: Tue Dec 16 14:00:02 2025 -0600
TIKA-4578: Pass all environment variables from Maven to docker-build.sh
- Pass MULTI_ARCH, AWS_REGION, AWS_ACCOUNT_ID, AZURE_REGISTRY_NAME, DOCKER_ID, PROJECT_NAME, RELEASE_IMAGE_TAG
- Update README with comprehensive Maven + env var examples
- Enable full control: MULTI_ARCH=false DOCKER_ID=ndipiazza PROJECT_NAME=tika-grpc RELEASE_IMAGE_TAG=4.0.0-SNAPSHOT mvn clean package -Dskip.docker.build=false
- Clean up duplicate examples in README
---
tika-grpc/docker-build/README.md | 53 +++++++++++++++++++++++++++++-----------
tika-grpc/pom.xml | 7 ++++++
2 files changed, 46 insertions(+), 14 deletions(-)
diff --git a/tika-grpc/docker-build/README.md b/tika-grpc/docker-build/README.md
index 3278ac95e..0a5c8ad09 100644
--- a/tika-grpc/docker-build/README.md
+++ b/tika-grpc/docker-build/README.md
@@ -37,6 +37,34 @@ mvn clean install -DskipTests -Dskip.docker.build=false
**Note:** By default, `skip.docker.build=true` to avoid running Docker builds during normal development.
+#### Controlling Docker Build with Environment Variables
+
+All docker-build.sh environment variables are passed through from your shell:
+
+```bash
+# Build and push to Docker Hub
+MULTI_ARCH=false DOCKER_ID=ndipiazza PROJECT_NAME=tika-grpc RELEASE_IMAGE_TAG=4.0.0-SNAPSHOT \
+ mvn clean package -Dskip.docker.build=false
+```
+
+```bash
+# Build multi-arch and push to Docker Hub
+MULTI_ARCH=true DOCKER_ID=myusername PROJECT_NAME=tika-grpc \
+ mvn clean package -Dskip.docker.build=false
+```
+
+```bash
+# Build and push to AWS ECR
+AWS_ACCOUNT_ID=123456789012 AWS_REGION=us-east-1 \
+ mvn clean package -Dskip.docker.build=false
+```
+
+```bash
+# Build and push to Azure Container Registry
+AZURE_REGISTRY_NAME=myregistry \
+ mvn clean package -Dskip.docker.build=false
+```
+
### Option 2: Run the Docker Build Script Manually
Set the required environment variable and run the script:
@@ -59,33 +87,30 @@ export TIKA_VERSION=4.0.0-SNAPSHOT
### Examples
-Build with Maven (recommended for CI/CD):
+**Maven build with Docker Hub (recommended):**
```bash
-mvn clean install -DskipTests -Dskip.docker.build=false -DdockerId=myusername
+MULTI_ARCH=false DOCKER_ID=ndipiazza PROJECT_NAME=tika-grpc RELEASE_IMAGE_TAG=4.0.0-SNAPSHOT \
+ mvn clean package -Dskip.docker.build=false
```
-Build and tag for Docker Hub (manual script):
+**Maven build with multi-arch:**
```bash
-export TIKA_VERSION=4.0.0-SNAPSHOT
-export DOCKER_ID=myusername
-./tika-grpc/docker-build/docker-build.sh
-docker push myusername/tika-grpc:4.0.0
+MULTI_ARCH=true DOCKER_ID=ndipiazza PROJECT_NAME=tika-grpc \
+ mvn clean package -Dskip.docker.build=false
```
-Build and push to AWS ECR:
+**Maven build with AWS ECR:**
```bash
-export TIKA_VERSION=4.0.0-SNAPSHOT
-export AWS_ACCOUNT_ID=123456789012
-export AWS_REGION=us-east-1
-./tika-grpc/docker-build/docker-build.sh
+AWS_ACCOUNT_ID=123456789012 AWS_REGION=us-east-1 \
+ mvn clean package -Dskip.docker.build=false
```
-Build multi-architecture image:
+**Manual script build and tag for Docker Hub:**
```bash
export TIKA_VERSION=4.0.0-SNAPSHOT
export DOCKER_ID=myusername
-export MULTI_ARCH=true
./tika-grpc/docker-build/docker-build.sh
+docker push myusername/tika-grpc:4.0.0
```
## Running the Docker Container
diff --git a/tika-grpc/pom.xml b/tika-grpc/pom.xml
index bdffe7453..ff3307b2b 100644
--- a/tika-grpc/pom.xml
+++ b/tika-grpc/pom.xml
@@ -421,6 +421,13 @@
</arguments>
<environmentVariables>
<TIKA_VERSION>${project.version}</TIKA_VERSION>
+ <MULTI_ARCH>${env.MULTI_ARCH}</MULTI_ARCH>
+ <AWS_REGION>${env.AWS_REGION}</AWS_REGION>
+ <AWS_ACCOUNT_ID>${env.AWS_ACCOUNT_ID}</AWS_ACCOUNT_ID>
+ <AZURE_REGISTRY_NAME>${env.AZURE_REGISTRY_NAME}</AZURE_REGISTRY_NAME>
+ <DOCKER_ID>${env.DOCKER_ID}</DOCKER_ID>
+ <PROJECT_NAME>${env.PROJECT_NAME}</PROJECT_NAME>
+ <RELEASE_IMAGE_TAG>${env.RELEASE_IMAGE_TAG}</RELEASE_IMAGE_TAG>
</environmentVariables>
<skip>${skip.docker.build}</skip>
</configuration>