def push_image(self, data): for tag in data[pipeline_data.IMAGE_TAGS]: tag_with_registry = f"{environment.get_registry_host()}/{tag}" docker.tag_image(data[pipeline_data.LOCAL_IMAGE_ID], tag_with_registry) docker.push(tag_with_registry) slack.on_successful_private_push_old(image_version_util.get_image(data), data[pipeline_data.IMAGE_SIZE])
def run_step(self, data): if environment.get_slim(): # Tag the image, otherwise we ger a bad reference error from docker build docker.tag_image(data[pipeline_data.LOCAL_IMAGE_ID], self.get_pre_slim_tag(data)) self.run_docker_slim(data) # Get the image tage created by docker slim and set this as the new # image id and name data[pipeline_data.LOCAL_IMAGE_ID] = self.get_new_image_id( self.get_post_slim_tag(data)) self.log.debug('Slimmed docker id is %s', data[pipeline_data.LOCAL_IMAGE_ID]) data[pipeline_data. IMAGE_NAME] = f'{data[pipeline_data.IMAGE_NAME]}.slim' return data
def tag(self, tag, data): #pragma: no cover docker.tag_image(data[pipeline_data.LOCAL_IMAGE_ID], tag) data[pipeline_data.IMAGE_TAGS].append(tag) self.log.info('Tagged image "%s" with "%s"', data[pipeline_data.LOCAL_IMAGE_ID], tag)
def push_image(self, data): for tag in data[pipeline_data.IMAGE_TAGS]: tag_with_registry = f"{environment.get_public_registry_host()}/{tag}" docker.tag_image(data[pipeline_data.LOCAL_IMAGE_ID], tag_with_registry) docker.push(tag_with_registry) slack.on_successful_public_push(tag, data[pipeline_data.IMAGE_NAME], data[pipeline_data.IMAGE_SIZE])
def _test_tag_image(self): docker.tag_image(DockerTests.IMAGE_ID, 'test_tag')