When running my Dockerfile I need to grab dependencies. This is done using go get ./...
.
However when doing docker build -t test .
it hangs at the go get command.
here is the error message
exec go get -v -d
github.com/gorilla/mux (download) cd .; git clone https://github.com/gorilla/mux /go/src/github.com/gorilla/mux Cloning into '/go/src/github.com/gorilla/mux'... fatal: unable to access 'https://github.com/gorilla/mux/': Could not resolve host: github.com package github.com/gorilla/mux: exit status 128
here is the dockerfile
FROM golang
# Create a directory inside the container to store all our application and then make it the working directory.
RUN mkdir -p /go/src/example-app
WORKDIR /go/src/example-app
# Copy the example-app directory (where the Dockerfile lives) into the container.
COPY . /go/src/example-app
# Download and install any required third party dependencies into the container.
RUN go-wrapper download
RUN go-wrapper install
RUN go get ./...
# Set the PORT environment variable inside the container
ENV PORT 8080
# Expose port 8080 to the host so we can access our application
EXPOSE 8080
# Now tell Docker what command to run when the container starts
CMD ["go-wrapper", "run"]