Skip to content

Commit

Permalink
Merge pull request #136 from whoan/issue-133
Browse files Browse the repository at this point in the history
Use context input as a prefix for the context from compose services
  • Loading branch information
whoan committed Oct 15, 2023
2 parents c70dd4f + d34709f commit 1f0152b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -70,8 +72,6 @@ or

- **image_name**

- **context**: Docker context (default: `./`).

- **dockerfile**: Dockerfile filename path (default: `"$context"/Dockerfile`).

## Outputs
Expand Down
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,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)"
Expand Down Expand Up @@ -103,7 +104,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}
Expand Down

0 comments on commit 1f0152b

Please sign in to comment.