How does docker build Images from github

  docker, question

There is an example in the official documents:

docker build  github.com/creack/docker-firefox

You can see the abovedocker-firefoxIs a repository and has oneDockerfileDocuments. Now I want to build a redis from github to the local image (and only need the version 2.8.10)
Then why can’t I do this:

# docker build github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10
 2014/11/05 16:20:32 Error trying to use git: exit status 128 (Initialized empty Git repository in /tmp/docker-build-git067001920/.git/
 error: The requested URL returned error: 403 while accessing https://github.com/docker-library/redis/tree/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10/info/refs
 
 fatal: HTTP request failed
 )
 
 This is no good either.
 # docker build https://github.com/docker-library/redis/blob/99c172e82ed81af441e13dd48dda2729e19493bc/2.8.10/Dockerfile
 2014/11/05 16:22:43 Invalid Dockerfile format

How do you write build?

The problem is that you did not correctly access the Dockerfile so that your host can normally access github first.