Skip to content

Commit

Permalink
Merge pull request #4 from jlesage/multi-tags
Browse files Browse the repository at this point in the history
Added support for multiple tags.
  • Loading branch information
ilteoood committed Feb 12, 2020
2 parents 468c74a + 4462c15 commit f2b0693
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The accepted inputs are:

| Name | Type | Default | Mandatory | Description |
|---------------|-----------|-----------|-------------|-----------------------------------------------------------------|
| `tag` | String | `latest` | No | Tag to apply to the image |
| `tag` | String | `latest` | No | Tags (*comma separated*) to apply to the image |
| `imageName` | String | | Yes | Name of the image |
| `dockerFile` | String | `Dockerfile` | No | Name of the Dockerfile |
| `publish` | Boolean | `false` | No | Indicate if the builded image should be published on Docker HUB |
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ branding:
color: blue
inputs:
tag:
description: "Tag to apply to the image"
description: "Tags (comma separated) to apply to the image"
default: "latest"
imageName:
description: "Name of the image"
Expand Down
7 changes: 6 additions & 1 deletion scripts/docker_build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/sh -l
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx build --platform $1 -t $2:$3 -f $4 .
DOCKER_BUILDX_TAG_OPTS=
for TAG in $(echo "$3" | tr ',' ' ')
do
DOCKER_BUILDX_TAG_OPTS="$DOCKER_BUILDX_TAG_OPTS --tag $2:$TAG"
done
docker buildx build --platform $1 $DOCKER_BUILDX_TAG_OPTS -f $4 .
7 changes: 6 additions & 1 deletion scripts/docker_build_push.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/sh -l
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx build --platform $1 --push -t $2:$3 -f $4 .
DOCKER_BUILDX_TAG_OPTS=
for TAG in $(echo "$3" | tr ',' ' ')
do
DOCKER_BUILDX_TAG_OPTS="$DOCKER_BUILDX_TAG_OPTS --tag $2:$TAG"
done
docker buildx build --platform $1 --push $DOCKER_BUILDX_TAG_OPTS -f $4 .

0 comments on commit f2b0693

Please sign in to comment.