Skip to content

Commit 497effd

Browse files
committed
oscap_docker_util.py: use container id instead of generating a name
1 parent bd448ab commit 497effd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/oscap_docker_python/oscap_docker_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ def __init__(self, target, is_image=False, oscap_binary='oscap'):
6161
self.image_name, self.config = self._get_image_name_and_config(target)
6262
if self.image_name:
6363
print("Creating a temporary container for the image...")
64-
self.container_name = "tmp_oscap_" + str(uuid.uuid1())
6564

6665
try:
6766
tmp_cont = self.client.create_container(
6867
self.image_name, name=self.container_name)
6968

69+
self.container_name = tmp_cont["Id"]
7070
self.config = self.client.inspect_container(self.container_name)
7171
except Exception as e:
7272
sys.stderr.write("Cannot create container for image {0}.\n".format(self.image_name))

0 commit comments

Comments
 (0)