From 38b482ce06ee79b7ce164f58fa8459d34dcef150 Mon Sep 17 00:00:00 2001 From: Juan Eugenio Abadie Date: Sun, 15 Oct 2023 12:34:45 +0200 Subject: [PATCH 1/2] Use context input as a prefix for the context from compose services --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index da2017f..1194ced 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,6 +14,7 @@ fi merged_compose=/tmp/merged-compose.yml original_INPUT_IMAGE_TAG=$INPUT_IMAGE_TAG +original_INPUT_CONTEXT=$INPUT_CONTEXT build_from_compose_file() { echo -e "\nBuilding from Compose file(s)" @@ -95,7 +96,7 @@ _set_variables() { fi INPUT_CONTEXT=$(_get_context_by_service_name "$service_name") - INPUT_CONTEXT=${INPUT_CONTEXT:-.} + INPUT_CONTEXT=$original_INPUT_CONTEXT/${INPUT_CONTEXT:-.} INPUT_DOCKERFILE=$(_get_dockerfile_by_service_name "$service_name") INPUT_DOCKERFILE=${INPUT_DOCKERFILE:-Dockerfile} From d34709fae6504ea37338e9a452a9384bab68b5dc Mon Sep 17 00:00:00 2001 From: Juan Eugenio Abadie Date: Sun, 15 Oct 2023 12:52:42 +0200 Subject: [PATCH 2/2] Update docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d30245..988e983 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ or - **image_tag**: Tag(s) of the image. Allows multiple comma-separated tags (e.g. `one,another`) (default: `latest`). If you set **compose_file** and the image(s) already has/have a tag, this is ignored. +- **context**: Docker context (default: `./`). If a **compose_file** is provided, it will be the context prefixed to any additional context read from the compose file. Look at #133 for more details. + - **registry**: Docker registry (default: *Docker Hub's registry*). You need a registry to use the cache functionality. - **username**: Docker registry's user (needed to push images, or to pull from a private repository). @@ -68,8 +70,6 @@ or - **image_name** -- **context**: Docker context (default: `./`). - - **dockerfile**: Dockerfile filename path (default: `"$context"/Dockerfile`). ## Outputs