• David Johnson's avatar
    When user supplies external Docker image or Dockerfile, validate them. · fdcd1b4d
    David Johnson authored
    We try to emulate the standard Docker CLI's image handling.  Thus, if
    user specifies an image like 'ubuntu', we turn that into
    'ubuntu:latest'.  If user does not supply a registry host, we try
    'registry.hub.docker.com'.  If they do not specify a registry host or
    specify a registry host that is either registry-1.docker.io or
    registry.hub.docker.com, and their image does not contain a /, we
    prepend 'library/' to it (I *think* this is the right heuristic, but
    it's inference).
    
    For Dockerfiles, we must be able to download it, and it must contain a
    line matching ^\s*FROM (i.e. a valid FROM instruction, which all
    Dockerfiles must have).  We try to support DOS-mode textfiles too, but
    only ASCII.
    
    Might need to loosen these checks.
    fdcd1b4d
GeniCM.pm.in 264 KB