Tag:

静态转到二进制文件与Docker – 找不到入口点

在OSX上 ,我使用了Static Go Binaries和 Nicola Paolucci的Docker来尝试使用静态Go二进制文件(Docker)。 我相信我正确地遵循了每一步,但是当我运行最终的图像时,我得到了来自Docker的以下错误响应。 注意我的服务和可执行文件的名称是netverify docker: Error response from daemon: Container command '/netverify' not found or does not exist.. 我的Dockerfile.static看起来像下面… #Create a minimal container to run a Golang static binary FROM tianon/true ADD netverify / EXPOSE 8282 CMD ["/netverify"] 我的Dockerfile.build看起来像下面这样… FROM golang ADD Makefile / WORKDIR / RUN make setup ADD . […]

如何使用engine-api监视docker事件

任何人谁知道如何看docker事件与引擎,API客户端docker,或有任何这样的例子?

docker错误:卷指定不存在的驱动程序内存

根据文档,有一个docker卷的“inmemory”驱动程序: https : //docs.docker.com/registry/storage-drivers/inmemory/ 纯粹为了testing目的,您可以使用内存存储驱动程序。 该驱动程序是storagedriver.StorageDriver接口的一个实现,它使用本地内存来存储对象。 但是当试图像这样使用它: volumes: ui-tmp-memory: driver: inmemory 它给了我这个输出: Creating volume "myapp_ui-tmp-memory" with inmemory driver ERROR: Volume ui-tmp-memory specifies nonexistent driver inmemory 我错过了什么,或者我需要安装“inmemory”驱动程序吗?

如何使用GOLang官方图像导入不受欢迎的软件包到Docker?

我已经将这个问题作为imagick git存储库上的一个问题发布了,但是它有一个非常小的用户基础,所以我希望能够从这里获得一些帮助。 我已经尝试了几天现在导入https://github.com/gographics/imagick到Docker使用官方goLang dockerfile为我正在处理的项目,但一直没有成功。 由于这个软件包不太stream行,运行apt-get将不起作用。 我(犹豫)试图只是将文件添加到容器,但没有奏效。 这里是我build立的DockerFile和它产生的错误:=== DOCKERFILE === # 1) Use the official go docker image built on debian. FROM golang:latest # 2) ENV VARS ENV GOPATH $HOME/<PROJECT> ENV PATH $HOME/<PROJECT>/bin:$PATH # 3) Grab the source code and add it to the workspace. ADD . /<GO>/src/<PROJECT> ADD . /<GO>/gopkg.in # Trying to add the […]

Docker在完成Golang项目构build之前退出

我正在尝试使用Docker来构build一个Golang项目,但是这个过程在它完成之前一直保持退出状态,下面是terminal输出的一部分: github.com/kataras/go-template (download) Fetching https://golang.org/x/crypto/acme/autocert?go-get=1 Parsing meta tags from https://golang.org/x/crypto/acme/autocert?go-get=1 (status code 200) get "golang.org/x/crypto/acme/autocert": found meta tag main.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/acme/autocert?go-get=1 get "golang.org/x/crypto/acme/autocert": verifying non-authoritative meta tag The command '/bin/sh -c go get -v' returned a non-zero code: 1 我的Dockerfile看起来像这样: FROM golang:1.7 RUN mkdir -p $GOPATH/src/bitbucket.org/cram/rolldrove WORKDIR $GOPATH/src/bitbucket.org/cram/rolldrove COPY . $GOPATH/src/bitbucket.org/cram/rolldrove RUN go […]

/ bin / sh:1:gvm:找不到

问题: 我试图创build一个Dockerfile来安装运行Go的所有组件,安装GVM(Go版本pipe理) ,并安装特定的Go版本。 错误: 当我尝试用以下方法构build容器时: docker build -t ##### . 我得到这个错误: / bin / sh:1:gvm:找不到 命令“/ bin / sh -c gvm install go1.4-B”返回一个非零的代码:127 安装在这里: /root/.gvm/scripts/env/gvm /root/.gvm/scripts/gvm /root/.gvm/bin/gvm 我试过的: 它显然能够安装GVM,但无法使用它。 为什么? 我想也许我需要刷新.bashrc或.bash_profile …但没有奏效,因为它们不存在。 Dockerfile: FROM #####/##### #Installing Golang dependencies RUN apt-get -y install curl git mercurial make binutils bison gcc build-essential #Installing Golang RUN ["/bin/bash", "-c", […]

“使用的内存”度量标准:转到工具pprof与docker统计信息

我写了一个golang应用程序,运行在我的每个docker容器中。 它通过tcp和udp使用protobufs相互通信,并使用Hashicorp的成员列表库来发现我的networking中的每个容器。 在docker统计我看到内存使用情况线性增加,所以我试图find我的应用程序中的任何泄漏。 由于它是一个持续运行的应用程序,我使用http pprof来检查任何一个容器中的实时应用程序。 我看到runtime.MemStats.sys是常量,即使docker统计是线性增加。 我的使用空间在1MB左右,而且随着时间的推移,课程的空间不断增加。 这是一个alloc_space的示例: root@n3:/app# go tool pprof –alloc_space main http://localhost:8080/debug/pprof/heap Fetching profile from http://localhost:8080/debug/pprof/heap Saved profile in /root/pprof/pprof.main.localhost:8080.alloc_objects.alloc_space.005.pb.gz Entering interactive mode (type "help" for commands) (pprof) top –cum 1024.11kB of 10298.19kB total ( 9.94%) Dropped 8 nodes (cum <= 51.49kB) Showing top 10 nodes out of 34 (cum >= 1536.07kB) […]

运行在Docker容器(Ubuntu)的窗口中创build的应用程序

我创build了非常简单的应用程序,用于输出一些文本。 我的开发环境是Windows + Docker for Windows。 我创build了Ubuntu的容器,并在Ubuntu的Windows中构build我的应用程序 set GOARCH=amd64 set GOOS=linux go build -o "myapp" 然后,我将“myapp”文件复制到共享文件夹,并在我的容器的共享文件夹中看到它。 在我尝试在容器中运行它之后,却出现错误 为什么我不能运行它? 它是不正确的构build还是我尝试以一些错误的方式执行它? 在Windows中,当我运行我的exe文件时,我有这个输出,我想在Ubuntu中有相同的东西。 更新build议我尝试./myapp,并存在Exec格式错误

Dokku部署问题无法select构build包

您好我试图设置一个数字海洋服务器随着dokku,每当我推我的本地golang应用程序到dokku服务器,我收到以下错误: unable to select buildpack 以及通用的: ! [remote rejected] dev -> master (pre-receive hook declined) error: failed to push some refs to 'dokku@….:tiny-web' 我已经启用了dokku追踪,并在这里创造了一个要点。 我怎样才能解决这个问题? 提前致谢

Golang Webserver无法从Docker访问

我在Go中使用Gorilla框架来公开一个web服务。 我在/hello有一个“Hello World”端点,当从Postman,浏览器或curl命中时,它工作正常。 当我将其与Docker捆绑在一起时,问题就出现了。 我的Dockerfile如下 FROM alpine COPY ./target/himer-users-go /app ENV PORT 9000 RUN echo $PORT ENTRYPOINT /app EXPOSE ${PORT} 现在我可以ssh入容器,并使用wget ping服务器(因为alpine不curl ) 但是,当我运行像这样的图像 docker run -d -p 9000:9000 namespace/image 我无法以任何方式从我的主机系统访问服务器。 任何帮助将不胜感激。