Adjust output formatting

This commit is contained in:
Joe 2021-04-30 21:43:40 -05:00
parent 044f63a10a
commit 8f71fce660
5 changed files with 15 additions and 22 deletions

View File

@ -52,13 +52,14 @@ Options
> See the `example/` directory for a complete working example, summarized below:
```
> printf 'FROM busybox \n RUN mkdir app && echo "Hello World!" > /app/testfile.txt' | docker build -t infogulch/test-image -
...
> docker artifact label infogulch/test-image /app/testfile.txt
Successfully added labels to 'infogulch/test-image':
{
"/app/testfile.txt": "sha256:..."
}
> printf 'FROM busybox \n RUN mkdir app && echo "Hello World!" > /app/testfile.txt' | docker build -t infogulch/artifact-test -
=> [internal] load build definition from Dockerfile
...
=> => writing image sha256:bc8ff9e88a0908f50f3c39b640a2f5a39f6cb5b7bce60510673d5da4f3e6e704
=> => naming to docker.io/infogulch/artifact-test
> docker artifact label infogulch/artifact-test /app/testfile.txt
** Rebuilt image 'infogulch/artifact-test' to add 1 labels
** Run 'docker push infogulch/artifact-test' to push it to your container repository
> docker push infogulch/test-image
...
> docker artifact download infogulch/test-image /app/testfile.txt

View File

@ -122,8 +122,8 @@ function label {
LOG "All image labels:"$'\n'"$(docker image inspect "$image" | jq '.[0].Config.Labels' | sed 's_^_ _' )"
# Remind user to push image
echo " [*] Rebuilt image '$image' to add $foundcount labels"
echo " [*] Run 'docker push $image' to push it to your container repository"
echo " ** Rebuilt image '$image' to add $foundcount labels"
echo " ** Run 'docker push $image' to push it to your container repository"
}
function delete_files {
@ -133,7 +133,7 @@ function delete_files {
export verbose=1
function LOG {
[ $verbose ] && >&2 echo -e "$(tput setaf 4) ==> $@$(tput sgr0)"
[ $verbose ] && >&2 echo -e "$(tput setaf 4) => $@$(tput sgr0)"
}
# Export functions used in subshells

View File

@ -1,4 +0,0 @@
FROM busybox
ADD testfile.txt .
RUN rm testfile.txt && mkdir app && echo "hello" > /app/othertestfile.txt

View File

@ -1,16 +1,13 @@
#!/usr/bin/env bash
set -e
source=$(dirname "${BASH_SOURCE[0]}")
pushd "$source" &> /dev/null
pushd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null
# Build example image
echo "Rebuilding docker image for example"
docker build . -t infogulch/test-image &> /dev/null
printf 'FROM busybox \n RUN mkdir app && echo "Hello World!" > /app/testfile.txt' | docker build -t infogulch/artifact-test - &> /dev/null
# Execute docker artifact to add a label to /app/othertestfile.txt
set +e
../docker-artifact.sh artifact label infogulch/test-image /app/othertestfile.txt
# Execute docker artifact to add a label that identifies /app/testfile.txt
../docker-artifact.sh artifact label infogulch/artifact-test /app/testfile.txt
popd &> /dev/null

View File

@ -1 +0,0 @@
hi