2019-03-11 17:38
浏览 85


I am trying to run golang application which use goracle library with such Dockerfile:

FROM golang:1.12

RUN go get && \
  go get && \
  go get && \
  go get && \
  go get && \
  go get

ADD ./ /go/src/application

WORKDIR /go/src/application

RUN go build -o /bin application


CMD ["/bin"]

Unfortunatly it raise error when I try to create image:

package unrecognized import path "" (https fetch: Get proxyconnect tcp: tls: first record does not look like a TLS handshake)
The command '/bin/sh -c go get &&   go get &&   go get &&   go get &&   go get &&   go get' returned a non-zero code: 1

Why I can't install goracle library in Docker? How to fix this problem?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • du127953 2019-03-13 17:18

    In my case the CentOS server where was located Docker has proxy. For thats why I couldn't download the package.


    1) Create vender folder inside your project.

    2) Remove source code of package which you has in go/src folder to vender folder.

    3) Run you Dockerfile.

    In my case this instruction removed problem with importing of package.

    I hope this post will helpful for somebody!

    解决 无用
    打赏 举报

相关推荐 更多相似问题