As far as I can tell Docker communicates with remote repositories at Docker Hub using the REST API. This document overviews how repos work and how Docker Hub itself is setup: https://docs.docker.com/v1.7/docker/reference/api/hub_registry_spec/ I do not know if v1.7 is the latest version of the spec.
Looking at the Docker hub REST api documentation, right now the only option for requests requireing authentication is to validate with Basic auth over SSL or with a Token. This means using your dockerhub credentials at one point or another--your credentials are to obtain a token.
I don't know how long a Token last for. If it's indefinite you could us it like an API key, requesting one and putting that in your code. Somehow I suspect it's temporary, however, like Oauth tokens are meant to be.