benmarwick / rrtools

rrtools: Tools for Writing Reproducible Research in R
Other
671 stars 85 forks source link

Upper Case in github repo leads to error in docker build #12

Closed MartinHinz closed 7 years ago

MartinHinz commented 7 years ago

from Travis run:

$ docker build -t $REPO .
invalid argument "MartinHinz/mytestpackagerr" for t: invalid reference format: repository name must be lowercase

Question: generally catch this by lowercase for docker?

MartinHinz commented 7 years ago

Just tried it out, the place seem to be actually the first initialisation of REPO in

env:
  global:
  - REPO=martinhinz/mytestpackagerr

tried it somewere lower by hand in after_success, but there it had no effect

benmarwick commented 7 years ago

hmm, I can't immediately think of what is going on there!

benmarwick commented 7 years ago

Are your GitHub and hub.docker.com usernames exactly the same? This is assumed by the function.

MartinHinz commented 7 years ago

Actually not, because docker, but not Github, forced me loser case. Should have been wiser choosing my Github name in the first place.

MartinHinz commented 7 years ago

So, for all the people that were as inconsistent as me, is it worth adding a param for entering a divergent username for dockerhub?

benmarwick commented 7 years ago

Does it work if you use your hub.docker.com username in this?

env:
  global:
  - REPO=martinhinz/mytestpackagerr
MartinHinz commented 7 years ago

Yes, id did. But it is not very obvious to someone not having got your lesson to know that this line in the travis.yml is the one that alters the behaviour in respect to docker. But maybe renaming REPO to DOCKERREPO might do that trick, or do I miss something of its relevance?

benmarwick commented 7 years ago

I see, thanks. So maybe we can have an argument for the docker hub username like this:

rrtools::use_dockerfile(hub_username = github_username)

The default would be the user's GitHub username. But then you have the option to easily supply a different one for the Dockerfile. For people who enjoy complicated online lives with many different usernames :stuck_out_tongue_winking_eye:

MartinHinz commented 7 years ago

The man with a thousand faces

MartinHinz commented 7 years ago

Shall I implement that for you?

benmarwick commented 7 years ago

Sure, thanks!