Skip to content

Commit

Permalink
add basic labels to the built image so users can find upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Morgan committed Nov 1, 2017
1 parent 30b16a9 commit 8a59d92
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,14 @@ RUN /rpmsquirt.sh
# Precautionary failure with messages
#
CMD echo 'Vulnerable image' && /bin/false

# Basic labels.
# http://label-schema.org/
#
LABEL \
org.label-schema.name="bad-dockerfile" \
org.label-schema.description="Reference Dockerfile containing software with known vulnerabilities." \
org.label-schema.url="http://www.stindustries.net/docker/bad-dockerfile/" \
org.label-schema.vcs-type="Git" \
org.label-schema.vcs-url="https://github.com/ianmiell/bad-dockerfile" \
org.label-schema.docker.dockerfile="/Dockerfile"
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Created by Adrian Portelli.

Image available here: https://hub.docker.com/r/imiell/bad-dockerfile

Upstream source code here: https://github.com/ianmiell/bad-dockerfile

But note that it's insecure!


Expand All @@ -39,3 +41,19 @@ If your build host needs proxy settings to reach the Internet:

# Replace ... with exotic curl options for your build environment.
docker build -t imiell/bad-dockerfile --build-arg CURL_OPTIONS="..." ./


View labels
-----------

Each built image has labels that generally follow http://label-schema.org/

View a specific label, such as the image description:

docker inspect \
-f '{{ index .Config.Labels "org.label-schema.description" }}' \
imiell/bad-dockerfile

Query all the labels inside a built image:

docker inspect imiell/bad-dockerfile | jq -M '.[].Config.Labels'

0 comments on commit 8a59d92

Please sign in to comment.