Skip to content

Commit e0b036c

Browse files
authored
Merge pull request #28 from kkolk/master
2 parents 9c282bf + 1ba1139 commit e0b036c

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ steps:
8888
- docker#v3.3.0
8989
```
9090

91-
The subdirectory containing the Dockerfile is the path used for the build's context.
92-
9391
### Specifying a target step
9492

9593
A [multi-stage Docker build] can be used to reduce an application container to
@@ -109,6 +107,22 @@ steps:
109107
- docker#v3.3.0
110108
```
111109

110+
### Specifying build context
111+
112+
The subdirectory containing the Dockerfile is the path used for the build's context by default.
113+
114+
The `context` property can be used to specify a different path.
115+
116+
```yaml
117+
steps:
118+
- command: cargo test
119+
plugins:
120+
- seek-oss/docker-ecr-cache#v1.8.0:
121+
dockerfile: dockerfiles/test/Dockerfile
122+
context: '.'
123+
- docker#v3.3.0
124+
```
125+
112126
### Specifying build args
113127

114128
[Build-time variables] are supported, either with an explicit value, or without

hooks/pre-command

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ target="${BUILDKITE_PLUGIN_DOCKER_ECR_CACHE_TARGET:-}"
1414
export_env_variable="${BUILDKITE_PLUGIN_DOCKER_ECR_CACHE_EXPORT_ENV_VARIABLE:-"BUILDKITE_PLUGIN_DOCKER_IMAGE"}"
1515
exec 3>&1
1616
tag="$(compute_tag "${docker_file}" 2>&3)"
17-
context="$(dirname "${docker_file}")"
17+
docker_file_dir="$(dirname "${docker_file}")"
18+
context="${BUILDKITE_PLUGIN_DOCKER_ECR_CACHE_CONTEXT:-"${docker_file_dir}"}"
1819

1920
build_args=()
2021
read_build_args

plugin.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ configuration:
2323
type: number
2424
export-env-variable:
2525
type: string
26+
context:
27+
type: string
2628
registry-provider:
2729
type: string
2830
gcp-project:

0 commit comments

Comments
 (0)