DockerMake icon indicating copy to clipboard operation
DockerMake copied to clipboard

port in docker registry url

Open paleozogt opened this issue 7 years ago • 0 comments

Given a simple DockerMake.yml:

foobar:
    FROM: ubuntu:xenial

we can build prepend a Docker registry URL like this:

$ docker-make -r quay.io/elvis foobar
...
  docker-make built: quay.io/elvis/foobar

docker-make finished.
Built: 
 * quay.io/elvis/foobar

However, if the registry is running on a non-standard port it causes problems:

$ docker-make -r quay.io:5005/elvis foobar
...
Traceback (most recent call last):
  File "/usr/local/bin/docker-make", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/dockermake/__main__.py", line 38, in main
    run(args)
  File "/usr/local/lib/python2.7/site-packages/dockermake/__main__.py", line 88, in run
    built, warnings = utils.build_targets(args, defs, targets)
  File "/usr/local/lib/python2.7/site-packages/dockermake/utils.py", line 144, in build_targets
    pull=args.pull)
  File "/usr/local/lib/python2.7/site-packages/dockermake/builds.py", line 114, in build
    self.finalizenames(client, finalimage)
  File "/usr/local/lib/python2.7/site-packages/dockermake/builds.py", line 145, in finalizenames
    client.api.tag(finalimage, *self.targetname.split(':'))
  File "/usr/local/lib/python2.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/docker/api/image.py", line 532, in tag
    self._raise_for_status(res)
  File "/usr/local/lib/python2.7/site-packages/docker/api/client.py", line 231, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/lib/python2.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("invalid tag format")

But this is a valid registry URL as far as Docker is concerned:

$ docker tag quay.io/elvis/foobar quay.io:5005/elvis/foobar
$ docker images | grep elvis 
quay.io/elvis/foobar                latest              0b1edfbffd27        4 months ago        113MB
quay.io:5005/elvis/foobar           latest              0b1edfbffd27        4 months ago        113MB

paleozogt avatar Sep 20 '18 15:09 paleozogt