(self, tag)
Docker pull image tag
Docker pull image tag
Docker pull image tag
def _pull(self, tag):
        """Docker pull image tag"""
        self.logger.debug('Checking tag: %s', tag)
        try:
            if self.config.dry_run:
                # The authentication doesn't work with this call
                # See bugs https://github.com/docker/docker-py/issues/2225
                return self.client.images.get_registry_data(tag)
            else:
                if self.config.auth_json:
                    return_image = self.client.images.pull(tag, auth_config=self.config.auth_json)
                else:
                    return_image = self.client.images.pull(tag)
                return return_image
        except APIError as e:
            if '<html>' in str(e):
                self.logger.debug("Docker api issue. Ignoring")
                raise ConnectionError
            elif 'unauthorized' in str(e):
                if self.config.dry_run:
                    self.logger.error('dry run : Upstream authentication issue while checking %s. See: '
                                      'https://github.com/docker/docker-py/issues/2225', tag)
                    raise ConnectionError
                else:
                    self.logger.critical("Invalid Credentials. Exiting")
                    exit(1)
            elif 'Client.Timeout' in str(e):
                self.logger.critical(
                    "Couldn't find an image on docker.com for %s. Local Build?", tag)
                raise ConnectionError
            elif ('pull access' or 'TLS handshake') in str(e):
                self.logger.critical("Couldn't pull. Skipping. Error: %s", e)
                raise ConnectionError
def _pull ( self , tag ) : self . logger . debug ( 'Checking tag: %s' , tag ) try : if self . config . dry_run : # The authentication doesn't work with this call # See bugs https://github.com/docker/docker-py/issues/2225 return self . client . images . get_registry_data ( tag ) else : if self . config . auth_json : return_image = self . client . images . pull ( tag , auth_config = self . config . auth_json ) else : return_image = self . client . images . pull ( tag ) return return_image except APIError as e : if '<html>' in str ( e ) : self . logger . debug ( "Docker api issue. Ignoring" ) raise ConnectionError elif 'unauthorized' in str ( e ) : if self . config . dry_run : self . logger . error ( 'dry run : Upstream authentication issue while checking %s. See: ' 'https://github.com/docker/docker-py/issues/2225' , tag ) raise ConnectionError else : self . logger . critical ( "Invalid Credentials. Exiting" ) exit ( 1 ) elif 'Client.Timeout' in str ( e ) : self . logger . critical ( "Couldn't find an image on docker.com for %s. Local Build?" , tag ) raise ConnectionError elif ( 'pull access' or 'TLS handshake' ) in str ( e ) : self . logger . critical ( "Couldn't pull. Skipping. Error: %s" , e ) raise ConnectionError