#NEWLINE# def _get_docker_image_history_slow( image_id ) : #NEWLINE# #INDENT# proc = subprocess . Popen ( ( 'docker history -q --no-trunc %s' % image_id ) , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) #NEWLINE# history_img_ids = proc . stdout . read ( ) . split ( ) #NEWLINE# ( out , err ) = proc . communicate ( ) #NEWLINE# if ( proc . returncode != 0 ) : #NEWLINE# #INDENT# raise RuntimeError ( 'Could not run docker command' ) #NEWLINE# #UNINDENT# proc = subprocess . Popen ( ( 'docker inspect %s' % ' ' . join ( history_img_ids ) ) , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) #NEWLINE# image_history = [ ] #NEWLINE# inspect_data = proc . stdout . read ( ) #NEWLINE# ( out , err ) = proc . communicate ( ) #NEWLINE# if ( proc . returncode != 0 ) : #NEWLINE# #INDENT# raise RuntimeError ( 'Could not run docker command' ) #NEWLINE# #UNINDENT# inspect_arr = json . loads ( inspect_data ) #NEWLINE# for inspect in inspect_arr : #NEWLINE# #INDENT# docker_datetime = dp . parse ( inspect [ 'Created' ] ) #NEWLINE# epoch_seconds = docker_datetime . strftime ( '%s' ) #NEWLINE# image_info = { #NEWLINE# #INDENT# 'Tags' : None , #NEWLINE# 'Size' : inspect [ 'Size' ] , #NEWLINE# 'Id' : inspect [ 'Id' ] , #NEWLINE# 'CreatedBy' : inspect [ 'ContainerConfig' ] [ 'Cmd' ] , #NEWLINE# 'Created' : epoch_seconds , #NEWLINE# #UNINDENT# } #NEWLINE# image_history . append ( inspect_data ) #NEWLINE# #UNINDENT# return image_history