Tag:

用docker构buildpkg_config_path错误

当我通过docker为Go应用程序构build图像时,出现以下错误: #pkg-config –cflags oci8 在pkg-configsearchpath中找不到包oci8。 也许你应该把包含`oci8.pc'的目录添加到PKG_CONFIG_PATH环境variables中。找不到包'oci8'pkg-config:exit status 1 我也在我的Dockerfile中设置了环境variables。 但问题仍然存在。 我的Dockerfile是: FROM golang:1.9 ARG app_env ENV APP_ENV $ app_env ENV GOPATH / home / nupur / mapi-go ENV PKG_CONFIG_PATH / home / nupur / mapi-go ENV ORACLE_HOME /usr/include/oracle/11.2/client64 ENV LD_LIBRARY_PATH / usr / lib / oracle /11.2/client64/lib WORKDIR / home / nupur / mapi-go / […]

dockerbuild设去应用程序私人github

我试图从我的应用程序构build一个docker图像。 github回购是私人的。 我有一点新的去(和docker),但我认为通过glidepipe理的/vendor文件应该绕过这个问题? 另外为什么docker工人必须从github获得一切? 一切都在当地提供。 命令: docker build -t testimage . Dockerfile FROM golang:1.8-onbuild 它在这一步失败 exec go get -v -d ……. fatal: could not read Username for 'https://github.com': No such device or address 我怎样才能解决这个问题? 谢谢

使用auhorization插件启动GOCD服务器时出错

我在gocd-server docker启动时得到以下错误: [2017-12-05 14:46:36,252 ERROR \[Thread-75\] PluginInfoBuilder:55 – Failed to fetch Plugin Settings metadata for plugin cd.go.authentication.ldap. Maybe the plugin does not implement plugin settings and view? 2017-12-05 14:46:36,269 WARN \[Thread-75\] pcgalcgalLdapPlugin:67 \[plugin-cd.go.authentication.ldap\] – Request go.plugin-settings.get-configuration is not supported by plugin. 2017-12-05 14:46:36,270 ERROR \[Thread-75\] PluginSettingsMetadataLoader:75 – Failed to fetch Plugin Settings metadata for plugin […]

获取stream错误:streamID 1; 在容器中使用Golang中的GooglesearchAPI时的PROTOCOL_ERROR

当在docker群服务中使用Go程序时,我得到一个400状态和一个错误消息stream ID 1; PROTOCOL_ERROR 当我调用一个client.Get(url)时, stream ID 1; PROTOCOL_ERROR我得到一个200和结果,当我go run *.go 。 我在Mozilla的容器中使用了“CA根证书的包”。 任何帮助赞赏。 我的代码如下。 client := &http.Client{Timeout: 30 * time.Second, Transport: &http.Transport{ DisableCompression: true, DisableKeepAlives: true, }} r, err := client.Get(url) if err != nil { return err } defer r.Body.Close() bodyBytes, err := ioutil.ReadAll(r.Body) if err != nil { fmt.Println(url, err) // The […]

dockerpipe理员如何获得200而不是401的返回码

在工作docker是无法拉图像: [b209d3c5] +job pull(ubuntu, ) [debug] registry.go:372 [registry] Calling GET https://index.docker.io/v1/repositories/ubuntu/images [debug] http.go:160 https://index.docker.io/v1/repositories/ubuntu/images — HEADERS: map[User-Agent:[docker/1.0.0 go/go1.2.2 git-commit/63fe64c kernel/3.15.1-1-ARCH os/linux arch/amd64]] [debug] server.go:1182 Retrieving the tag list [debug] http.go:160 https://cdn-registry-1.docker.io/v1/repositories/library/ubuntu/tags — HEADERS: map[User-Agent:[docker/1.0.0 go/go1.2.2 git-commit/63fe64c kernel/3.15.1-1-ARCH os/linux arch/amd64]] [debug] registry.go:327 Got status code 401 from https://cdn-registry-1.docker.io/v1/repositories/library/ubuntu/tags [error] server.go:1185 Could not reach any registry endpoint […]

在Docker上安装运行时是否有意义?

我正在考虑在Docker上部署一些应用程序(aws beanstalk是提供程序)。 通过各种资源,我发现它build议使用一个基本的图像,在我的情况下官方 golang图像,但我想知道为什么你需要在容器上安装运行时(即Golang)。 是不是你应该在docker集装箱上部署的二进制文件?

在Docker for Go程序中构buildDocker

我正在尝试为Go程序构build一个非常小的Docker容器。 为此,我希望使用Docker容器来构buildGo程序,然后(在容器内)构build另一个Docker容器来运行程序。 这是我的构buildDockerfile: FROM google/golang WORKDIR /gopath/src/mycompany/mygoprog # Build the Contributors application RUN mkdir -p /gopath/src/mycompany/mygoprog ADD ./src/* /gopath/src/mycompany/mygoprog/ RUN CGO_ENABLED=0 GOOS=linux go build -a -tags rs -ldflags '-w' /gopath/src/mycompany/mygoprog/*.go RUN cp mygoprog /mygoprog CMD docker build -t foobar /gopath/src/mycompany/mygoprog 我的源代码目录有我的Go程序(简单 – 编译/运行)和最终产品的Dockerfile: FROM scratch ADD /mygoprog mygoprog ENTRYPOINT ["/mygoprog"] EXPOSE 9100 这些文件是这样组织的: /myproject Dockerfile […]

在Docker Swarm集群上访问Couchbase容器的IP地址

尝试在Docker Swarm集群上运行Couchbase集群。 集群启动后,我想dynamic获取每个Couchbase实例的IP地址。 docker inspect显示: "NetworkSettings": { "Bridge": "", "SandboxID": "325807d55b552be3fe5b44b4d975c2486b3a56b320aa56fa0367e42348b82d64", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": { "11207/tcp": null, "11210/tcp": [ { "HostIp": "192.168.99.101", "HostPort": "11210" } ], 试图访问IP地址给出了错误: docker inspect –format '{{ .NetworkSettings.Ports.8091/tcp[0].HostIp }}' 922755302fef Template parsing error: template: :1: unexpected ".8091" in operand; missing space? 访问IP地址的格式是什么?

标准输出缓冲在docker集装箱中

我不完全确定这里发生了什么,但是当我在一个容器中运行我的代码时,似乎stdout被缓冲了,但是如果我在主机或OSX上运行它,则不会。 https://github.com/myles-mcdonnell/procwrap/blob/master/procwrap.go 相关部分(为简洁起见): cmd := exec.Command("ping", "127.0.0.1") logger := &lumberjack.Logger{ Filename: conf.LogFile, MaxSize: conf.MaxLogSizeMb, MaxBackups: conf.MaxLogBackups, MaxAge: conf.MaxLogAgeDays, } cmd.Stdout = io.MultiWriter(os.Stdout, logger) err := cmd.Run() 在一个容器中运行的subprocess运行良好,但我只看到输出(到标准输出和日志文件)的间隔,如缓冲区正在刷新。 在容器外部运行它,并在生成时输出。 我正在使用去1.6.3。 我看到相同的行为交互式地在后台运行容器。 Docker版本: Client: Version: 1.10.3 API version: 1.22 Go version: go1.5.3 Git commit: 20f81dd Built: Thu Mar 10 21:49:11 2016 OS/Arch: darwin/amd64 Server: Version: 1.12.0 API […]

使用Docker获取包超时 – “golang.org/x/net/context/ctxhttp”

我尝试使用go Docker镜像来导入这个包 。 从包的文档中,要运行的命令是: go get gopkg.in/olivere/elastic.v3 作品,够公平的。 我需要对docker镜像做同样的事情: docker run -v $PWD:/temp -w /temp -e GOPATH=$PWD -e GOBIN=$PWD/bin golang:latest go get gopkg.in/olivere/elastic.v3 但是我得到了以下错误: 包golang.org/x/net/context:无法识别的导入path“golang.org/x/net/context”(https访问:获取https://golang.org/x/net/context?go-get=1 :拨号tcp:查找golang.org在192.168.65.1:53:读取udp 172.17.0.2:46904->192.168.65.1:53:I / O超时) 包golang.org/x/net/context/ctxhttp:无法识别的导入path“golang.org/x/net/context/ctxhttp”(https访问:获取https://golang.org/x/net/context/ctxhttp? go-get = 1 :拨号tcp:查找golang.org 192.168.65.1:53:读取udp 172.17.0.2:44687->192.168.65.1:53:I / O超时) 这是为什么?