vadimi / go-http-ntlm

NTLM authenticated http request for Go
MIT License
54 stars 23 forks source link

Error while pulling the src from docker file #12

Closed koolshanthan closed 4 years ago

koolshanthan commented 4 years ago

Hi,

While i am using " RUN go get -u github.com/vadimi/go-http-ntlm" from my docker file i am getting below error

"# github.com/vadimi/go-http-ntlm src/github.com/vadimi/go-http-ntlm/ntlmtransport.go:50:29: resp.Header.Values undefined (type http.Header has no field or method Values)"

vadimi commented 4 years ago

hello, it's hard to tell what's going on without seeing the whole Dockerfile, but you can try to run it like that:

go get -u github.com/vadimi/go-http-ntlm/v2 to get version 2.x

If it doesn't work please post your Dockerfile contents

koolshanthan commented 4 years ago

Hi Vadimi, Attached is the docker file. I have changed it version 2. I am getting below error **"Step 7/20 : RUN go get -u github.com/vadimi/go-http-ntlm/v2 ---> Running in 63251f047363

package github.com/vadimi/go-http-ntlm/v2: cannot find package "github.com/vadimi/go-http-ntlm/v2" in any of: /usr/local/go/src/github.com/vadimi/go-http-ntlm/v2 (from $GOROOT) /go/src/github.com/vadimi/go-http-ntlm/v2 (from $GOPATH)**

Docker file

`FROM golang:1.10-alpine

ENV WORKDIR /go/src/DefectFilling ENV GOPATH /go

RUN apk update; apk add curl; apk add git

WORKDIR $WORKDIR

RUN go get -u github.com/julienschmidt/httprouter RUN go get -u github.com/vadimi/go-http-ntlm/v2 RUN go get -u github.com/spf13/viper RUN go get -u github.com/streadway/amqp RUN go get -u github.com/Sirupsen/logrus RUN go get -u github.com/natefinch/lumberjack

Copy the local package files to the container's workspace.

ADD . .

COPY ./config ./config COPY ./listener ./listener COPY ./models ./models COPY ./utils ./utils

RUN ls -lt

WORKDIR $WORKDIR/listener RUN go build server.go RUN ls -lt

CMD ["./server"]`

vadimi commented 4 years ago

I see, go 1.10 is used in your Dockerfile. I only tested it on go 1.14 and above. The following Dockerfile worked for me:

FROM golang:1.14-alpine

ENV WORKDIR /go/src/DefectFilling
ENV GOPATH /go

RUN apk update; apk add curl; apk add git

WORKDIR $WORKDIR

RUN GO111MODULE=on go get -u github.com/vadimi/go-http-ntlm/v2
vadimi commented 4 years ago

let me know if there is anything else needs to be done here, closing for now.