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 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}