Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #118 from matusmarhefka/container-help
Browse files Browse the repository at this point in the history
Support for atomic help feature
  • Loading branch information
jan-cerny authored Nov 14, 2017
2 parents 74cdc86 + f392eb8 commit 4c70679
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
19 changes: 19 additions & 0 deletions container/help.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

DOCKER="/usr/bin/docker"
SELF=$1

VERSION=$(${DOCKER} inspect -f '{{ index .Config.Labels "version" }}' ${SELF})
RELEASE=$(${DOCKER} inspect -f '{{ index .Config.Labels "release" }}' ${SELF})
if [ -z ${RELEASE} ]; then
echo -e "${SELF} image version: ${VERSION}\n"
else
echo -e "${SELF} image version: ${VERSION}-${RELEASE}\n"
fi

DESCRIPTION=$(${DOCKER} inspect -f '{{ index .Config.Labels "description" }}' ${SELF})
echo -e "Description:\n${DESCRIPTION}\n"

echo "OpenSCAP packages bundled in ${SELF} image:"
rpm -qa | grep openscap
rpm -qa | grep scap-security-guide
6 changes: 4 additions & 2 deletions generate-dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
("io.k8s.description", "OpenSCAP is an auditing tool that utilizes the Extensible Configuration Checklist Description Format (XCCDF). XCCDF is a standard way of expressing checklist content and defines security checklists."),
("io.openshift.tags", "security openscap scan"),
("install", "docker run --rm --privileged -v /:/host/ IMAGE sh /root/install.sh IMAGE"),
("run", "docker run -it --rm -v /:/host/ IMAGE sh /root/run.sh")
("run", "docker run -it --rm -v /:/host/ IMAGE sh /root/run.sh"),
("help", "docker run --rm --privileged -v /usr/bin:/usr/bin -v /var/run:/var/run -v /lib:/lib -v /lib64:/lib64 -v /etc/sysconfig:/etc/sysconfig IMAGE sh /root/help.sh IMAGE")
]
packages = [
"bzip2",
Expand All @@ -24,7 +25,8 @@
("container/run.sh", "/root"),
("container/openscap", "/root"),
("container/config.ini", "/root"),
("container/remediate.py", "/root")
("container/remediate.py", "/root"),
("container/help.sh", "/root")
]
env_variables = [
("container", "docker")
Expand Down

0 comments on commit 4c70679

Please sign in to comment.