Skip to content

Commit

Permalink
use default docker command line values for file when it is missing
Browse files Browse the repository at this point in the history
Signed-off-by: Libo Zeng <libo@mabl.com>
  • Loading branch information
liboz committed Dec 18, 2020
1 parent f2a733f commit a8587cb
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ Following inputs can be used as `step.with` keys
|---------------------|----------|------------------------------------|
| `builder` | String | Builder instance (see [setup-buildx](https://github.com/docker/setup-buildx-action) action) |
| `context` | String | Build's context is the set of files located in the specified [`PATH` or `URL`](https://docs.docker.com/engine/reference/commandline/build/) (default [Git context](#git-context)) |
| `file` | String | Path to the Dockerfile (default `./Dockerfile`) |
| `file` | String | Path to the Dockerfile. (default `{context}/Dockerfile`) |
| `build-args` | List | List of build-time variables |
| `labels` | List | List of metadata for an image |
| `tags` | List/CSV | List of tags |
Expand Down
8 changes: 0 additions & 8 deletions __tests__/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ describe('getArgs', () => {
'buildx',
'build',
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
'--file', 'Dockerfile',
'.'
]
],
Expand All @@ -162,7 +161,6 @@ describe('getArgs', () => {
'--build-arg', 'MY_ARG=val1,val2,val3',
'--build-arg', 'ARG=val',
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
'--file', 'Dockerfile',
'https://github.com/docker/build-push-action.git#test-jest'
]
],
Expand All @@ -177,7 +175,6 @@ describe('getArgs', () => {
'--tag', 'name/app:7.4',
'--tag', 'name/app:latest',
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
'--file', 'Dockerfile',
'https://github.com/docker/build-push-action.git#test-jest'
]
],
Expand All @@ -194,7 +191,6 @@ describe('getArgs', () => {
'--label', 'org.opencontainers.image.title=buildkit',
'--label', 'org.opencontainers.image.description=concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit',
'--output', 'type=local,dest=./release-out',
'--file', 'Dockerfile',
'.'
]
],
Expand All @@ -208,7 +204,6 @@ describe('getArgs', () => {
'buildx',
'build',
'--platform', 'linux/amd64,linux/arm64',
'--file', 'Dockerfile',
'.'
]
],
Expand All @@ -221,7 +216,6 @@ describe('getArgs', () => {
'buildx',
'build',
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
'--file', 'Dockerfile',
'.'
]
],
Expand All @@ -236,7 +230,6 @@ describe('getArgs', () => {
'build',
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
'--secret', 'id=GIT_AUTH_TOKEN,src=/tmp/.docker-build-push-jest/.tmpname-jest',
'--file', 'Dockerfile',
'.'
]
],
Expand All @@ -251,7 +244,6 @@ describe('getArgs', () => {
'build',
'--output', '.',
'--secret', 'id=GIT_AUTH_TOKEN,src=/tmp/.docker-build-push-jest/.tmpname-jest',
'--file', 'Dockerfile',
'https://github.com/docker/build-push-action.git#test-jest'
]
],
Expand Down
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ inputs:
file:
description: "Path to the Dockerfile"
required: false
default: './Dockerfile'
build-args:
description: "List of build-time variables"
required: false
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function tmpNameSync(options?: tmp.TmpNameOptions): string {
export async function getInputs(defaultContext: string): Promise<Inputs> {
return {
context: core.getInput('context') || defaultContext,
file: core.getInput('file') || 'Dockerfile',
file: core.getInput('file'),
buildArgs: await getInputList('build-args', true),
labels: await getInputList('labels', true),
tags: await getInputList('tags'),
Expand Down

0 comments on commit a8587cb

Please sign in to comment.