Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use context input as a prefix for the context from compose services #136

Merged
merged 2 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -68,8 +70,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 @@ -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)"
Expand Down Expand Up @@ -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}
Expand Down
Loading