I'm trying to create a docker image that pulls from a both private and public github repositories. The dockerfile I'm using is
FROM golang:1.4.2-onbuild
ENV GOPATH /go
ENV PATH /go/bin:$PATH
EXPOSE 3000
RUN mkdir -p /go/src/github.com/eddi/api
RUN git clone https://<access token>@github.com/owner/repo.git /go/src/github.com/owner/repo
WORKDIR /go/src/github.com/eddi/api
RUN go get github.com/gin-gonic/gin
RUN go run server.go
But when I run docker build . I get the following error:
cd .; git clone https://github.com/gin-gonic/gin /go/src/github.com/gin-gonic/gin
Cloning into '/go/src/github.com/gin-gonic/gin'...
fatal: unable to access 'https://github.com/gin-gonic/gin/': Could not resolve h ost: github.com
for both private and public repositories. How can I get my dockerfile to behave well with importing libraries?