realityone / docker-image-py Goto Github PK
View Code? Open in Web Editor NEWParse docker image as distribution does.
License: Apache License 2.0
Parse docker image as distribution does.
License: Apache License 2.0
Running this code:
from docker_image import reference
reference.Reference.parse('123.dkr.ecr.eu-west-1.amazonaws.com:lol/abc:d')
It seems to hang, and CPU usage goes up.
Edit: Sorry, I wasn't clear. This is an invalid reference, but it ideally shouldn't cause a system to hang and experience CPU spikes if parsed.
When parsing images with both a /
and a :
, split_hostname()
returns the wrong hostname.
Example:
>>> from docker_image.reference import Reference
>>> Reference.parse_normalized_named("bitnami/minideb:buster").split_hostname()
('bitnami', 'minideb')
# Expected:
# ('docker.io', 'bitnami/minideb')
Leaving out the tag, split_hostname works as expected:
>>> Reference.parse_normalized_named("bitnami/minideb").split_hostname()
('docker.io', 'bitnami/minideb')
When parsing custom images (format: $user/$image
) from the default registry (docker hub), split_hostname()
returns the user name as registry hostname.
Example:
>>> from docker_image import reference
>>> ref = reference.Reference.parse('containous/traefik')
>>> ref.split_hostname()
('containous', 'traefik')
/ # python -V
Python 2.7.13
File "/usr/local/lib/python2.7/site-packages/docker_image/regexp.py", line 43, in
class ImageRegexps(object):
File "/usr/local/lib/python2.7/site-packages/docker_image/regexp.py", line 53, in ImageRegexps
optional(repeated(literal(r'.'), HOSTNAME_COMPONENT_REGEXP)),
File "/usr/local/lib/python2.7/site-packages/docker_image/regexp.py", line 16, in literal
return match(_quote_meta(s))
File "/usr/local/lib/python2.7/site-packages/docker_image/regexp.py", line 5, in _quote_meta
special_chars = regex._METACHARS
AttributeError: 'module' object has no attribute '_METACHARS'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.