Tag:

用UnixHTTPConnectionPool将Docker组合起来

在我们的Jenkins代理中,我们正在运行几个(大约20个)testing,其设置涉及运行docker-compose up大量的服务/容器(大约14个)。 不时,我会得到以下错误: ERROR: for testdb-data UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) An HTTP request took too long to complete. Retry with –verbose to obtain debug information. If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60). 一直没有能够重现这一点。 而且我还在试图弄清楚我们的代理人资源是否被充分利用。 docker -v是1.10.1 , docker-compose […]

从头开始非特权执行

我从头开始在图像上构build/部署go / golang微服务。 是否有可能在这种方式构build的图像上指定非特权执行 – 图像上只有两个文件 – 可执行文件和根证书文件 – 因此在容器中似乎没有任何特权的概念。 我也使用只读容器和–selinux-enabled = true –icc = false –iptables = true,但是如果我知道可执行文件是作为“普通”非特权用户运行的话,会感觉更加温暖和模糊。

如何从自定义dockerregistry与图像拖拉?

使用docker源如何从自定义registry中拉出图像? 由于使用这样的代码 // Prepare auth registry for usage func (app *App) PrepareRegistry() error { app.AuthConfig = types.AuthConfig{ Username: Username, Password: Password, ServerAddress: DefaultServer, } resp, err := app.Client.RegistryLogin(context.Background(), app.AuthConfig) if err != nil { panic(err) } fmt.Println(resp.Status) if resp.IdentityToken != "" { app.AuthConfig.IdentityToken = resp.IdentityToken } app.AuthConfigEncoded, err = command.EncodeAuthToBase64(app.AuthConfig) return err } func (app […]

Channgel创作失败。 GRPC超时

我正在按照下面的步骤来设置我的Mac上的结构环境的入门步骤,从这里提到的步骤:当我尝试启动我的networking使用./network_setup.sh up脚本时,我得到以下grpc超时错误(如附图中所示,任何人有什么想法我错过了什么?

如何使用VSCode在Docker中debuggingGolang应用程序?

我正在学习在Docker中debuggingGolang应用程序。 我在shell中使用dlv connect成功了。 我可以添加断点,继续,下一步…我可以在VSCode中注意到,但正在等待halting 。 我点击左侧的function主,直到红点。 然后点击绿色button,就像“玩”一样。 程序在容器中运行,但不能停在函数main上。 我以错误的方式使用VSCode吗? 我需要你的帮助。 谢谢。 这是我的钻研形象: #Dockerfile FROM supinf/go:1.8-builder RUN apk –no-cache add tini \ && apk –no-cache add –virtual build-dependencies git \ # Compile delve && go get github.com/derekparker/delve/cmd/dlv \ && cd $GOPATH/src/github.com/derekparker/delve \ && go install github.com/derekparker/delve/cmd/dlv \ # Clean up && apk del –purge -r build-dependencies […]

docker-compose oci运行时错误可执行文件未find(在链接的容器中)

我正在尝试设置docker&compose来运行集成testing 我有以下docker-compose.yml version: '3' services: tests: build: context: . dockerfile: Dockerfile.tests links: – web – maindb web: build: context: . dockerfile: Dockerfile.web ports: – "8080:8080" volumes: – .:/code – logvolume01:/var/log links: – maindb maindb: image: postgres environment: POSTGRES_PASSWORD: example volumes: logvolume01: {} Web容器本身工作得很好 $ docker-compose -p wh run web Starting wh_maindb_1 … done 2017/07/27 22:05:34 […]

如何在不同的容器中使用docker-comp env文件variables与golang?

. ├── articaleServer │ ├── Dockerfile │ ├── main.go │ └── sources.json ├── butler │ ├── Dockerfile │ ├── main.py │ └── requirements.txt ├── docker-compose.yml ├── frontEnd │ ├── Dockerfile │ ├── main.go │ ├── tags.json │ └── templates │ ├── auth.html │ ├── feed.html │ ├── footer.html │ ├── header.html │ ├── main.html │ […]

来自Docker的Golang编译caching

我正在使用官方的golang高山图像来编译我的源代码(我的主机是Mac),而且我注意到,即使在容器中挂载整个$GOPATH ,它也不会使用先前构build的caching数据。 我检查了它在$GOPATH/pkg目录中创build它,但它不影响后续的生成速度。 但是,如果我重复使用同一个容器进行多次编译,它确实使用了某种caching,您可以在本次实验中看到结果: 使用不同的容器,每个构build时间大约在28-30s左右: $ rm -r $GOPATH/pkg/linux_amd64 $ time docker run -v$GOPATH:/go -e CGO_ENABLED=0 golang:1.9-alpine3.6 go build -i github.com/myrepo/mypackage … 0.02s user 0.08s system 0% cpu 30.914 total $ time docker run -v$GOPATH:/go -e CGO_ENABLED=0 golang:1.9-alpine3.6 go build -i github.com/myrepo/mypackage … 0.02s user 0.07s system 0% cpu 28.128 total 重复使用相同的容器,后续的构build要快得多: $ rm -r […]

docker容器到memcached容器连接失败

我有一个Docker容器,它运行我用Go编写的主要后端代码。 我使用在另一个容器上运行的memcached 1.4.31。 我正在使用gomemcache库和有时候,当我想用​​提供的键删除一个项目我得到一个错误: read tcp BACKEND_SERVER_IP:44684->memcached_IP:11211: read: connection reset by peer 有任何想法吗?

将docker-compose.yml转换成DockerAPI / services / create接受的json?

我想通过用于Go-lang的Docker API将服务部署到已经运行的Docker Stack中。 由于dockerAPI只接受json的文档描述,所以我search了一个可以将compose.yaml转换为dockerAPI接受的json的工具。 或者,如果go-lang DockerAPI中有任何方法可以直接使用yaml数据创build服务,就像我们在compose.yml中提供的那样。 示例Yaml: myapp: image: amithp/pyapp:latest deploy: replicas: 3 restart_policy: condition: on-failure networks: – frontend-network environment: – MYENV=myapp labels: myproject: "xyz" label1: "somevar" 对于DockerAPI和Go-lang,我都是相当新的,任何build议或方向都会大有帮助。