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: > 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 - > 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
> docker artifact label infogulch/test-image /app/testfile.txt ...
Successfully added labels to 'infogulch/test-image': => => writing image sha256:bc8ff9e88a0908f50f3c39b640a2f5a39f6cb5b7bce60510673d5da4f3e6e704
{ => => naming to docker.io/infogulch/artifact-test
"/app/testfile.txt": "sha256:..." > 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 push infogulch/test-image
... ...
> docker artifact download infogulch/test-image /app/testfile.txt > 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_^_ _' )" LOG "All image labels:"$'\n'"$(docker image inspect "$image" | jq '.[0].Config.Labels' | sed 's_^_ _' )"
# Remind user to push image # Remind user to push image
echo " [*] Rebuilt image '$image' to add $foundcount labels" echo " ** Rebuilt image '$image' to add $foundcount labels"
echo " [*] Run 'docker push $image' to push it to your container repository" echo " ** Run 'docker push $image' to push it to your container repository"
} }
function delete_files { function delete_files {
@ -133,7 +133,7 @@ function delete_files {
export verbose=1 export verbose=1
function LOG { 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 # 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 #!/usr/bin/env bash
set -e
source=$(dirname "${BASH_SOURCE[0]}") pushd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null
pushd "$source" &> /dev/null
# Build example image # Build example image
echo "Rebuilding docker image for example" 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 # Execute docker artifact to add a label that identifies /app/testfile.txt
set +e ../docker-artifact.sh artifact label infogulch/artifact-test /app/testfile.txt
../docker-artifact.sh artifact label infogulch/test-image /app/othertestfile.txt
popd &> /dev/null popd &> /dev/null

View File

@ -1 +0,0 @@
hi