草庐IT

Linux_Docker

全部标签

linux - 避免解析 Xrandr 输出

我需要从xrandr获取信息到我的软件中。假设这就是我从xrandr-q输出的内容:Screen0:minimum8x8,current1920x1968,maximum32767x32767LVDS1connectedprimary1366x768+309+1200(normalleftinvertedrightxaxisyaxis)277mmx156mm1366x76860.02*+1360x76859.8059.961280x72060.001024x76860.001024x57660.00960x54060.00800x60060.3256.25864x48660.00640

linux - 尝试在 Windows 10 上为 Linux 构建 Go 代码时出错

我尝试使用CGO_ENABLED=1在Windows上构建Go代码。我有一个.bat文件setGOOS=linuxsetGOARCH=amd64setCGO_CFLAGS=-g-O2-wsetCGO_ENABLED=1gobuildmain.goconstants.gofunctions.go但是我得到错误:gcc_linux_amd64.c:Infunction'_cgo_sys_thread_start':gcc_linux_amd64.c:62:2:error:unknowntypename'sigset_t'sigset_tign,oset;^我该怎么办?我在任何地方都找不到这

docker - golang 程序在 docker 之外运行良好,但在 dockerized 时以 0 退出

我有以下docker-compose.yml文件:version:"3.3"services:api:build:./apiexpose:-'8080'container_name:'api'ports:-"8080:8080"depends_on:-dbstdin_open:truetty:truenetworks:-api-netdb:build:./dbexpose:-'27017'container_name:'mongo'ports:-"27017:27017"networks:-api-netnetworks:api-net:driver:bridgeapi容器的Docke

docker - 使用 Golang api 构建 docker 镜像时复制失败

我正在尝试使用官方GOAPI构建Docker镜像,但我在这一行遇到了问题:COPYpackages/tmp/packages的"message":"COPYfailed:stat/var/lib/docker/tmp/docker-builder107969114/packages:nosuchfileordirectory"其中packages是docker文件所在目录下的一个文件夹。如果我只是将docker镜像构建到Dockerfile的路径,它会按预期构建。我尝试将WORKDIR添加到Dockerfile在实际Dockerfile中的路径,但它似乎仍然找不到该文件夹​​。有人知道

docker - 无法使用Sarama Golang软件包创建Kafka生产者客户端-“客户端/元数据在获取元数据时从代理处出错:EOF”

版本:GoLang1.10.2卡夫卡4.4.1Docker18.03.1我正在尝试使用Shopify的Sarama软件包来测试我的Kafka实例。我使用Dockercompose来站起Kafka/Zookeeper,并且一切都成功运行。当我尝试使用Sarama创建Producer客户端时,会引发错误。当我运行以下packagemainimport("fmt""log""os""os/signal""time""strconv""github.com/Shopify/sarama")funcmain(){//Setupconfigurationconfig:=sarama.NewConf

docker - 在 docker 中构建 golang 项目 - 在 $GOPATH 或 $GOROOT 中找不到包

这个问题在这里已经有了答案:BuildDockerwithGoapp:cannotfindpackage(6个答案)关闭3年前。我有一个项目,路径为/Users/me/Documents/dev/grafana/src/github.com/grafana/grafana。该项目使用了其他几个项目,例如:/Users/me/Documents/dev/grafana/src/github.com/BurntSushi/toml/Users/me/Documents/dev/grafana/src/github.com/Unknwon/com我可以在我的机器上构建一切正常,但是当我尝试在

linux - 从 Linux 内核虚拟文件系统中检索信息

我想编写一个实用程序,根据/proc目录中可用的数据进行一些报告。读取和解析我感兴趣的虚拟文件的内容就这么简单吗?在做类似的事情时,我已经看到在Python中实现了这种方法。在Go中有更好的方法来做到这一点吗?对于背景故事,我在Linux上使用ZFS并希望从此虚拟文件检索数据:/proc/spl/kstat/zfs/arcstats这是一个直接对该文件进行操作的Python程序。 最佳答案 IsthisassimpleasreadingandparsingthecontentsofthevirtualfileIamintereste

opencv - 在 ARM Docker 容器中构建 OPENCV 时出现问题

我在ARMDocker容器中构建OPENCV时遇到问题:--Configuringincomplete,errorsoccurred!Seealso"/tmp/opencv/opencv-3.4.2/build/CMakeFiles/CMakeOutput.log".Seealso"/tmp/opencv/opencv-3.4.2/build/CMakeFiles/CMakeError.log".Thecommand'/bin/sh-ccd/tmp/opencv/opencv-3.4.2&&mkdirbuild&&cdbuild&&cmake-DCMAKE_BUILD_TYPE=REL

docker - 从一个 Dockerized Go 服务获取查询到其他 Dockerized Go 服务

我在Go中构建了一些服务,我可以使用docker-compose部署它们。我还链接了服务,但现在如果我从一个应用程序向另一个应用程序发出GET请求,我会得到不支持的协议(protocol)方案。这是因为我在URL中使用服务名称而没有指定任何协议(protocol)。链接和查询适用于mongoDB,但不适用于其他服务。去service1文件url:="service2/get"//thisisnotworkingresponse,err:=http.Get(url)iferr!=nil{fmt.Printf("%s",err)}else{//dosomething}Docker-comp

docker - 在存储库 docker.io/library/golang 中找不到标签 1.10.3 AS base

当我尝试编译moby(最新版本2018.08.07)时,结果是这样的:dockerbuild-t"docker-dev:master"-f"Dockerfile".SendingbuildcontexttoDockerdaemon43.28MBStep1:FROMgolang:1.10.3ASbasePullingrepositorydocker.io/library/golangTag1.10.3ASbasenotfoundinrepositorydocker.io/library/golangmake:***[build]Error1我的主机是:centos6Linuxli1202