Go在Docker容器中找不到/ usr / share / zoneinfo

在Go程序中,我调用 time.LoadLocation(“ Europe / Berlin”)</ code>和 它返回一个错误,指出 open /usr/local/go/lib/time/zoneinfo.zip:没有这样的文件或目录</ code>,即使在容器中(运行 alpine:3.9 </ code >,并已安装tzdata) / usr / share / zoneinfo / Europe / Berlin </ code>存在,并且根据文档,应优先于zip文件。 同一程序在我的计算机上找到文件(Arch Linux)。 可执行文件在我的机器上被静态链接,然后复制到容器中。 我尝试使用Go 1.11.5和1.10.3。</ p>

我使用以下命令构建了可执行文件:</ p>

  CGO_ENABLED = 0 go build -a-  ldflags“ -s” -o gocake_static 
</ code> </ pre>

我正在寻找可以帮助我确定问题的任何想法。</ p>
</ div>

展开原文

原文

In a Go program I call time.LoadLocation("Europe/Berlin") and it returns an error saying open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory, even though in the container (running alpine:3.9 with tzdata installed) /usr/share/zoneinfo/Europe/Berlin exists and, according to the docs, should take precedence over the zip file. The same program finds the file on my machine (Arch Linux). The executable got statically linked on my machine and then copied into the container. I tried Go 1.11.5 and 1.10.3.

I built the executable with:

CGO_ENABLED=0 go build -a -ldflags "-s" -o gocake_static

I'm looking for any ideas that help me identify the problem.

douxing9567
douxing9567 在安装了tzdata的go:1.11.5和alpine:3.9下,我无法重现该问题。我在Mac中构建了二进制文件(GOOS=linuxGOARCH=amd64CGO_ENABLED=0)并将其放入高山容器中。我没有设置ZONEINFO变量。是否还有其他env变量可能导致此问题?
一年多之前 回复
dsimib1625
dsimib1625 您所看到的是stdlib代码无法在任何已知的内置位置中找到tzdata,因此最后一个尝试在Go的根目录中尝试找到带有tzdata的zip存档安装失败,并显示。
一年多之前 回复
dozxos6346
dozxos6346 请查看Go运行时如何查找时区信息(针对1.11.5);这是与UNIX兼容的位置。基本上,看来AlpineLinux关于tzdata位置的想法与Gostdlib的想法不同。
一年多之前 回复
duanbodai5166
duanbodai5166 是的。
一年多之前 回复
doujiao1949
doujiao1949 是否安装了tzdata软件包?(在正式的Ubuntu镜像中不是)。
一年多之前 回复
doulouli8686
doulouli8686 设置ZONEINFO变量似乎没有什么不同。我尝试将其设置为/usr/share/zoneinfo。
一年多之前 回复
dongtan4046
dongtan4046 不,我没有。它应该是相同的架构,不是吗?我将构建命令添加到我的问题中。
一年多之前 回复
dongsaohu6429
dongsaohu6429 ...在容器上设置了ZONEINFOenv变量,如果是,它的值是多少?
一年多之前 回复
dpw5865
dpw5865 构建该可执行文件时,是否指定了容器的os和arch?可以共享用于生成可执行文件的命令吗?
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
容器中挂载docker:/usr/bin/docker: 2: .: Can't open····

按照如下方式生成jenkins容器,并挂载docker: ``` docker run -d -p 8080:8080 --name jenkins -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock csphere/jenkins:1.609 ``` 容器正常启动,但是在容器中无法使用docker指令: ![图片说明](https://img-ask.csdn.net/upload/201711/24/1511526587_994728.png) 一开始以为是文件的权限问题,但是已经修改文件的权限仍无法解除bug

docker容器中通过/var/run/docker.sock挂载文件时,会在宿主机上创建同名目录,导致挂载失败(are you trying to mount a directory onto a file )。

1. 宿主机环境ubuntu 16.04, docker 17.12.0-ce, 通过/var/run/docker.sock把docker共享给jenkins容器. ``` docker run -u root -d -p 8080:8080 -v jenkins-data:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins ``` 在jenkins容器中启动docker-compose,配置文件如下: ``` nginx: image: nginx ports: - "80:80" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/Web:/home/docker/Web - ./nginx/codebase:/home/docker/codebase - static:/home/docker/static - media:/home/docker/media - logs:/home/docker/logs environment: - LANG=C.UTF-8 ``` 2. 执行后会报错: ``` mounting \\\"/var/jenkins_home/workspace/test/emqttd/acl.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/e36922fe836d35b78435ba89ec2a4c9c7f3a5439ab9cd0d0d6a240cdbd938dab/merged\\\" at \\\"/var/lib/docker/overlay2/e36922fe836d35b78435ba89ec2a4c9c7f3a5439ab9cd0d0d6a240cdbd938dab/merged/opt/emqx/etc/acl.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? ``` 同时宿主机器上,会创建出同名目录 ![图片说明](https://img-ask.csdn.net/upload/202003/31/1585634759_860795.jpg) 3. 请问为什么会在宿主机器上出现和挂载文件同名的目录?该文件不是应该仅出现在jenkins容器中吗?如何解决该问题?

Golang在Docker映像中找不到软件包

<div class="post-text" itemprop="text"> <p>So, I am trying to dockerize a golang application with different directories containing supplementary code for my main file. I am using <strong>gorilla/mux</strong>. The directory structure looks like this. </p> <pre><code>$GOPATH/src/github.com/user/server |--- Dockerfile |--- main.go |--- routes/ handlers.go |--- public/ index.gohtml </code></pre> <p>It works on my host machine with no problem. The problem is that when I try to deploy the docker image it does not run and exits shortly after creation. I have tried changing the <strong>WORKDIR</strong> command in my dockerfile to <strong>/go/src</strong> and dump all my files there, but still no luck. I have also tried the official documentation on <a href="https://hub.docker.com/_/golang" rel="nofollow noreferrer">docker hub</a>. Doesn't work either.</p> <p>My Dockerfile.</p> <pre><code>FROM golang:latest WORKDIR /go/src/github.com/user/server COPY . . RUN go get -d github.com/gorilla/mux EXPOSE 8000 CMD ["go","run","main.go"] </code></pre> <p>My golang <strong>main.go</strong> </p> <pre class="lang-golang prettyprint-override"><code>package main import ( "github.com/gorilla/mux" "github.com/user/server/routes" "log" "net/http" "time" ) func main(){ //... } </code></pre> <p>I get this error message when I check the logs of my docker image. </p> <p><strong>Error Message</strong> </p> <pre><code>main.go:5:2: cannot find package "github.com/user/server/routes" in any of: /usr/local/go/src/github.com/user/server/routes (from $GOROOT) /go/src/github.com/user/server/routes (from $GOPATH) </code></pre> </div>

在Alpine Docker容器中从源代码编译Go时出错:“ loadinternal:找不到运行时/ cgo”

<div class="post-text" itemprop="text"> <p>I'm trying to build an Alpine Docker image for the FIPS-enabled version of Go. To do this, I am trying to build Go from source using the <code>dev.boringcrypto</code> branch of the <code>golang/go</code> repository.</p> <p>Upon running <code>./all.bash</code>, I get the following errors:</p> <pre><code>Step 4/4 : RUN cd go/src &amp;&amp; ./all.bash ---&gt; Running in 00db552598f7 Building Go cmd/dist using /usr/lib/go. # _/go/src/cmd/dist loadinternal: cannot find runtime/cgo /usr/lib/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1 /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64- alpine-linux-musl/bin/ld: cannot find Scrt1.o: No such file or directory /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64- alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lssp_nonshared collect2: error: ld returned 1 exit status The command '/bin/bash -c cd go/src &amp;&amp; ./all.bash' returned a non-zero code: 2 </code></pre> <p>Which causes the installation tests to fail and kicks me out of the Docker image build.</p> <p>I have the <code>gcc</code> installed on the image, and tried setting the environment variable <code>CGO_ENABLED=0</code> as suggested in other questions, but neither of these things seem to alleviate the problem.</p> <p>I'm at my wits end with this problem. Has anybody else run into similar issues in the past? I don't understand why this is happening, as the build runs fine in an Ubuntu container.</p> <p>Thanks!</p> </div>

挑战性的Docker问题:如何干净删除手动安装的docker - ce?

工作环境:Ubuntu 18.04.1 因为docker自动的源老出问题,所以就选择了手动安装,过程出奇的简单,具体步骤: 1. 下载 docker-18.03.1-ce.tgz 2. 解压 tar xzvf docker-18.03.1-ce.tgz 3. cp docker/* /usr/bin/ 4. sudo docker run hello-world 所有网上可以查到的验证方法都可以通过, ``` sudo docker -v Docker version 18.03.1-ce, build 9ee9f40 ``` 安装了一个lamp Container ``` # service docker status ● docker.service - docker static Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-12-13 16:25:07 CST; 33min ago Main PID: 14560 (dockerd) Tasks: 47 (limit: 4915) CGroup: /system.slice/docker.service ├─14560 /usr/bin/dockerd ├─14567 docker-containerd --config /var/run/docker/containerd/containerd.toml ├─14828 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3307 -container-ip 172.17.0.2 -container-port 3306 ├─14840 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 81 -container-ip 172.17.0.2 -container-port 80 ├─14847 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/886220dd45f02bf04d52f39d46af4dd5 ├─14864 /bin/bash ├─14995 /usr/sbin/apache2 -k start ├─15000 /usr/sbin/apache2 -k start ├─15001 /usr/sbin/apache2 -k start ├─15007 /usr/sbin/apache2 -k start ├─15008 /usr/sbin/apache2 -k start ├─15009 /usr/sbin/apache2 -k start ├─15010 /usr/sbin/apache2 -k start ├─15011 /usr/sbin/apache2 -k start ├─15012 /usr/sbin/apache2 -k start └─15013 /usr/sbin/apache2 -k start 12月 13 16:25:07 Dell dockerd[14560]: time="2018-12-13T16:25:07.246084925+08:00" level=warning msg="Your kernel does not support cgroup rt runtime" ``` docker ps -a; docker start lamp; docker stop lamp; 等命令都可以正常执行。 **但是这个安装无法正常卸载** ``` root@Dell:/home/work# apt-get remove docker docker-engine docker-ce docker.io 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 软件包 docker-engine 未安装,所以不会被卸载 软件包 docker-ce 未安装,所以不会被卸载 软件包 docker 未安装,所以不会被卸载 软件包 docker.io 未安装,所以不会被卸载 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 211 个软件包未被升级。 ``` **不知在此是否可以找到答案?** 其他相关信息: ``` $ sudo find / -iname docker /usr/bin/docker /run/docker /var/lib/docker /etc/docker /sys/fs/cgroup/pids/docker /sys/fs/cgroup/cpuset/docker /sys/fs/cgroup/memory/docker /sys/fs/cgroup/freezer/docker /sys/fs/cgroup/perf_event/docker /sys/fs/cgroup/blkio/docker /sys/fs/cgroup/hugetlb/docker /sys/fs/cgroup/cpu,cpuacct/docker /sys/fs/cgroup/net_cls,net_prio/docker /sys/fs/cgroup/devices/docker /sys/fs/cgroup/systemd/docker $ sudo find / -iname docker.service /etc/systemd/system/multi-user.target.wants/docker.service /sys/fs/cgroup/pids/system.slice/docker.service /sys/fs/cgroup/devices/system.slice/docker.service /sys/fs/cgroup/systemd/system.slice/docker.service /sys/fs/cgroup/unified/system.slice/docker.service /lib/systemd/system/docker.service ```

在docker文件中执行go build -o / bin / go_docker时找不到二进制文件

<div class="post-text" itemprop="text"> <p>below is the content of the dockerfile</p> <pre><code>FROM golang:1.8 as goimage ENV SRC=/go/src/ RUN mkdir -p /go/src/ RUN mkdir /go/src/go_docker WORKDIR /go/src/go_docker RUN cd /go/src/go_docker COPY StoreImage.go . RUN go build -o /bin/go_docker CMD ["/bin/go_docker"] </code></pre> <p>Docker build is successful for the above content.. But dont see the binary file generated in /bin/go_docker</p> <p>Can someone please help me with this.</p> </div>

在Docker容器中使用Go模块时找不到包错误

<div class="post-text" itemprop="text"> <p>Given I have some experience working with docker containers I decided to use docker containers to have a go environment and learn. Below is my dockerfile for go web app.</p> <pre><code>FROM golang:1.12.0-alpine3.9 as base ARG GO111MODULE=on RUN apk update &amp;&amp; apk add make bash git COPY ./app /go/src/app WORKDIR /go/src/app RUN go build COPY ./compose/local/golang/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh RUN go get github.com/oxequa/realize ENTRYPOINT [ "/entrypoint.sh" ] CMD ["realize", "start"] </code></pre> <p>My go.mod file</p> <pre><code>module github.com/rajeshyogeshwar/demoapp go 1.12 require ( github.com/Sirupsen/logrus v1.0.6 github.com/joho/godotenv v1.3.0 github.com/julienschmidt/httprouter v1.2.0 github.com/lib/pq v1.0.0 github.com/spf13/cobra v0.0.3 github.com/spf13/viper v1.2.0 ) </code></pre> <p>and finally my project folder structure</p> <p><a href="https://i.stack.imgur.com/RKJOT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RKJOT.png" alt="enter image description here"></a></p> <p>As we can see I am trying to use httprouter module and it has been defined in my go.mod file. But I keep getting following error.</p> <pre><code>app_1 | [06:46:56][APP] : Install app_1 | main.go:8:2: cannot find package "github.com/julienschmidt/httprouter" in any of: app_1 | /usr/local/go/src/github.com/julienschmidt/httprouter (from $GOROOT) app_1 | /go/src/github.com/julienschmidt/httprouter (from $GOPATH) </code></pre> <p>So if anyone can point out the obvious mistake it would be great.</p> </div>

在Alpine Linux Docker的路径中找不到已安装的Go二进制文件

<div class="post-text" itemprop="text"> <p>I've got a Go binary I'm trying to run on the Alpine Docker image.</p> <p>This works fine for the Docker Go binary.</p> <pre><code>docker run -it alpine:3.3 sh apk add --no-cache curl DOCKER_BUCKET=get.docker.com DOCKER_VERSION=1.9.1 curl -fSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-$DOCKER_VERSION" -o /usr/local/bin/docker chmod +x /usr/local/bin/docker docker help Usage: docker [OPTIONS] COMMAND [arg...] ... </code></pre> <p>However, for the Go binary I want to install.</p> <pre><code>RACK_BUCKET=ec4a542dbf90c03b9f75-b342aba65414ad802720b41e8159cf45.ssl.cf5.rackcdn.com RACK_VERSION=1.1.0-beta1 curl -fSL "https://${RACK_BUCKET}/${RACK_VERSION}/Linux/amd64/rack" -o /usr/local/bin/rack chmod +x /usr/local/bin/rack rack help sh: rack: not found /usr/local/bin/rack help sh: /usr/local/bin/rack: not found ls -al /usr/local/bin/ total 43375 drwxr-xr-x 2 root root 1024 Jan 11 18:10 . drwxr-xr-x 8 root root 1024 Jan 11 18:09 .. -rwxr-xr-x 1 root root 30222575 Jan 11 18:09 docker -rwxr-xr-x 1 root root 14190576 Jan 11 18:10 rack which rack /usr/local/bin/rack </code></pre> <p>I thought it might have something to do with <a href="https://stackoverflow.com/a/33240548/25991">this answer</a> but I don't get the same error when running <code>ldd</code>.</p> <pre><code>ldd /usr/local/bin/rack /lib64/ld-linux-x86-64.so.2 (0x7fdd15cd0000) libpthread.so.0 =&gt; /lib64/ld-linux-x86-64.so.2 (0x7fdd15cd0000) libc.so.6 =&gt; /lib64/ld-linux-x86-64.so.2 (0x7fdd15cd0000) </code></pre> <p>Any idea with this installed Go binary is not found in path on Alpine Linux Docker?</p> </div>

为什么我无法为docker获取go sdk?

<div class="post-text" itemprop="text"> <p>I am trying to run docker go SDK example file. I am quite new to Go language; I am not sure how to run below docker SDK API code. But I tried somehow; please help me with below error. </p> <p>When I tried to run this <code>go run example-ps.go</code></p> <p><a href="https://godoc.org/github.com/moby/moby/client" rel="nofollow noreferrer">example-ps.go</a> - content is below</p> <pre><code>package main import ( "io" "os" "github.com/docker/docker/client" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "golang.org/x/net/context" ) func main() { ctx := context.Background() cli, err := client.NewEnvClient() if err != nil { panic(err) } _, err = cli.ImagePull(ctx, "docker.io/library/alpine", types.ImagePullOptions{}) if err != nil { panic(err) } resp, err := cli.ContainerCreate(ctx, &amp;container.Config{ Image: "alpine", Cmd: []string{"echo", "hello world"}, }, nil, nil, "") if err != nil { panic(err) } if err := cli.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{}); err != nil { panic(err) } if _, err = cli.ContainerWait(ctx, resp.ID); err != nil { panic(err) } out, err := cli.ContainerLogs(ctx, resp.ID, types.ContainerLogsOptions{ShowStdout: true}) if err != nil { panic(err) } io.Copy(os.Stdout, out) } </code></pre> <p>I am getting below error. How do I import those library files?</p> <pre><code>example-ps.go:8:3: cannot find package "github.com/docker/docker/api/types" in any of: /usr/local/go/src/github.com/docker/docker/api/types (from $GOROOT) /Users/air/go/src/github.com/docker/docker/api/types (from $GOPATH) example-ps.go:9:3: cannot find package "github.com/docker/docker/api/types/container" in any of: /usr/local/go/src/github.com/docker/docker/api/types/container (from $GOROOT) /Users/air/go/src/github.com/docker/docker/api/types/container (from $GOPATH) example-ps.go:7:3: cannot find package "github.com/docker/docker/client" in any of: /usr/local/go/src/github.com/docker/docker/client (from $GOROOT) /Users/air/go/src/github.com/docker/docker/client (from $GOPATH) example-ps.go:10:3: cannot find package "golang.org/x/net/context" in any of: /usr/local/go/src/golang.org/x/net/context (from $GOROOT) /Users/air/go/src/golang.org/x/net/context (from $GOPATH) </code></pre> </div>

如何基于对/var/run/docker.sock的临时访问授予Docker容器

<div class="post-text" itemprop="text"> <p>I would like to use the Docker socket on the host from Go code running inside a container based on scratch.</p> <p>The Dockerfile looks something like this:</p> <pre><code> FROM golang:1.12.4-alpine3.9 as builder RUN mkdir /user &amp;&amp; \ echo 'nobody:x:65534:65534:nobody:/:' &gt; /user/passwd &amp;&amp; \ echo 'nobody:x:65534:' &gt; /user/group RUN apk add --no-cache ca-certificates git WORKDIR /src COPY go.mod ./ RUN go mod download COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . FROM scratch as final COPY --from=builder /user/group /user/passwd /etc/ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /src/app /app COPY --chown=nobody:nobody data /.local USER nobody:nobody ENTRYPOINT ["/app"] </code></pre> <p>The docker service itself includes a mount for the <code>/var/run/docker.sock</code></p> <p>Output from <code>docker service inspect</code>:</p> <pre><code> "Mounts": [ { "Type": "bind", "Source": "/var/run/docker.sock", "Target": "/var/run/docker.sock" } ], </code></pre> <p>Things I've tried:</p> <ol> <li><p><code>touch /var/run/docker.sock</code> on the <strong>builder</strong> and <code>COPY --chown=nobody:nobody --from=builder /var/run /var/run</code> in <strong>final</strong></p></li> <li><p>Different user (I refuse to run as root. It's bad practice).</p></li> <li><p>Adding nobody in <strong>final</strong> to the docker group.</p></li> </ol> <p>EDIT:</p> <p>Under this configuration I get the following error as <strong>nobody</strong> as a user does not have permission to access /var/run/docker.socket</p> <blockquote> <p>Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get <a href="http://%2Fvar%2Frun%2Fdocker.sock/v1.25/services" rel="nofollow noreferrer">http://%2Fvar%2Frun%2Fdocker.sock/v1.25/services</a>: dial unix /var/run/docker.sock: connect: permission denied</p> </blockquote> </div>

在docker容器内使用“读取目录。:输入/输出错误”时,golang:sshfs -o重新连接失败

<div class="post-text" itemprop="text"> <p>I am trying to mount a directory located on a host from a docker container using sshfs. The problem I am having is that once the golang app finishes executing the mountpoint disappears whereas it suppose to persist (the same steps performed manually are producing persistent results.</p> <p>The ssh client code:</p> <pre><code>package main import ( //"bytes" "code.google.com/p/go.crypto/ssh" //"fmt" "io" "log" "os" ) var ( server = "172.17.42.1:49155" username = "root" password = clientPassword("orobix2013") ) type clientPassword string func (p clientPassword) Password(user string) (string, error) { return string(p), nil } type TerminalModes map[uint8]uint32 const ( VINTR = 1 VQUIT = 2 VERASE = 3 VKILL = 4 VEOF = 5 VEOL = 6 VEOL2 = 7 VSTART = 8 VSTOP = 9 VSUSP = 10 VDSUSP = 11 VREPRINT = 12 VWERASE = 13 VLNEXT = 14 VFLUSH = 15 VSWTCH = 16 VSTATUS = 17 VDISCARD = 18 IGNPAR = 30 PARMRK = 31 INPCK = 32 ISTRIP = 33 INLCR = 34 IGNCR = 35 ICRNL = 36 IUCLC = 37 IXON = 38 IXANY = 39 IXOFF = 40 IMAXBEL = 41 ISIG = 50 ICANON = 51 XCASE = 52 ECHO = 53 ECHOE = 54 ECHOK = 55 ECHONL = 56 NOFLSH = 57 TOSTOP = 58 IEXTEN = 59 ECHOCTL = 60 ECHOKE = 61 PENDIN = 62 OPOST = 70 OLCUC = 71 ONLCR = 72 OCRNL = 73 ONOCR = 74 ONLRET = 75 CS7 = 90 CS8 = 91 PARENB = 92 PARODD = 93 TTY_OP_ISPEED = 128 TTY_OP_OSPEED = 129 ) func main() { // An SSH client is represented with a slete). Currently only // the "password" authentication method is supported. // // To authenticate with the remote server you must pass at least one // implementation of ClientAuth via the Auth field in ClientConfig. config := &amp;ssh.ClientConfig{ User: username, Auth: []ssh.ClientAuth{ // ClientAuthPassword wraps a ClientPassword implementation // in a type that implements ClientAuth. ssh.ClientAuthPassword(password), }, } client, err := ssh.Dial("tcp", "172.17.42.1:49155", config) if err != nil { panic("Failed to dial: " + err.Error()) } // Each ClientConn can support multiple interactive sessions, // represented by a Session. defer client.Close() // Create a session session, err := client.NewSession() if err != nil { log.Fatalf("unable to create session: %s", err) } defer session.Close() // Set up terminal modes modes := ssh.TerminalModes{ ECHO: 0, // disable echoing TTY_OP_ISPEED: 14400, // input speed = 14.4kbaud TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud } // Request pseudo terminal if err := session.RequestPty("xterm", 80, 40, modes); err != nil { log.Fatalf("request for pseudo terminal failed: %s", err) } //var b bytes.Buffer //session.Stdout = &amp;bi stdin, _ := session.StdinPipe() stdout, _ := session.StdoutPipe() go io.Copy(os.Stdout, stdout) go io.Copy(stdin, os.Stdin) //go io.Copy(os.Stderr, stderr) if err := session.Run("/bin/bash -c \"sshfs piotr@172.17.42.1:/home/piotr/helloworld/ /mnt -o idmap=user -o reconnect;touch /mnt/ofoo\""); err != nil { panic("Failed to run: " + err.Error()) } </code></pre> <p>The container is running in the background (-d) and I ssh into it to confrim that the mountpoint(/mnt/) is still there and this is what I am getting:</p> <pre><code>root@654b8fa08b9e:~# mount none on / type aufs (rw,relatime,si=77b99811b9d139a9) /dev/disk/by-uuid/7e1d6bab-b3f2-4ac3-8bff-0779f5bf40f2 on /etc/hostname type ext4 (ro,relatime,errors=remount-ro,data=ordered) /dev/disk/by-uuid/7e1d6bab-b3f2-4ac3-8bff-0779f5bf40f2 on /etc/hosts type ext4 (ro,relatime,errors=remount-ro,data=ordered) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k) /dev/disk/by-uuid/7e1d6bab-b3f2-4ac3-8bff-0779f5bf40f2 on /.dockerinit type ext4 (ro,relatime,errors=remount-ro,data=ordered) /dev/disk/by-uuid/7e1d6bab-b3f2-4ac3-8bff-0779f5bf40f2 on /etc/resolv.conf type ext4 (ro,relatime,errors=remount-ro,data=ordered) devpts on /dev/tty1 type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=666) devpts on /dev/ptmx type devpts (rw,relatime,mode=600,ptmxmode=666) piotr@172.17.42.1:/home/piotr/helloworld/ on /mnt type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,max_read=65536) root@654b8fa08b9e:~# cd /mnt/ root@654b8fa08b9e:/mnt# ls ls: reading directory .: Input/output error root@654b8fa08b9e:/mnt# </code></pre> <p>THe "mount" command shows that the mountpoint is there however when I am trying to access it I am getting: ls: reading directory .: Input/output error</p> <p>Can someone tell me how I can fix that please? I spend quite a lot of time on this without success, any input is very welcome!</p> <p>How to test it:</p> <p>I uploaded my testing docker container to the public repository so you can run and test it now yourself:</p> <p>First you need to start the container in the background with sshd running:</p> <p>sudo docker run -i -t -privileged -dns=172.25.0.10 -p 22 -d orobix/sshfs_startup_key2 /bin/bash -c "/usr/sbin/sshd -D"</p> <p>privileged is needed for the sshfs fuse system to work, I use dns option to specify my dns server because I am inside a local network(you might not need to) The image(orobix/ssfs_startuo_key2) should be pulled automatically from the public repository.</p> <p>Once the container is running you should be able to run the go code(of course ip addresses must be changed).</p> <p>You can ssh into container manually with e.g.:</p> <pre><code>ssh root@172.17.42.1 -p 49153 </code></pre> <p>Again, ip and ports will be different.</p> </div>

在docker容器中运行时,golang项目找不到依赖项

<div class="post-text" itemprop="text"> <p>I have this golang sandbox project: <a href="https://github.com/cflynn07/golang-db-gateway-example" rel="nofollow">https://github.com/cflynn07/golang-db-gateway-example</a></p> <p>When I try to run <code>gateway/gateway.go</code> inside a <code>golang:1.6.0-alpine</code></p> <pre><code>~/g/s/g/c/golang-db-gateway-example git:master ❯❯❯ docker-compose up gateway mysql_server is up-to-date Starting gateway Attaching to gateway gateway | gateway.go:7:2: cannot find package "github.com/go-sql-driver/mysql" in any of: gateway | /usr/local/go/src/github.com/go-sql-driver/mysql (from $GOROOT) gateway | /go/src/github.com/go-sql-driver/mysql (from $GOPATH) gateway | gateway.go:8:2: cannot find package "github.com/gorilla/mux" in any of: gateway | /usr/local/go/src/github.com/gorilla/mux (from $GOROOT) gateway | /go/src/github.com/gorilla/mux (from $GOPATH) gateway exited with code 1 </code></pre> <p>Why isn't the build step detecting my project's dependencies inside the <code>/example/vendor</code> folder?</p> <p>When I run <code>go run gateway/gateway.go</code> from my host OS, the command works.</p> <p><strong>Directory structure (mounted inside container at /example)</strong></p> <pre><code>~/g/s/g/c/golang-db-gateway-example git:master ❯❯❯ tree -L 3 . ├── README.md ├── client │   └── client.go ├── docker-compose.yml ├── gateway │   └── gateway.go ├── glide.lock ├── glide.yaml ├── tmp └── vendor └── github.com ├── go-sql-driver └── gorilla </code></pre> <hr> <p><br></p> <h2>Relevant files:</h2> <p><strong>docker-compose.yml</strong></p> <pre><code>mysql: container_name: mysql_server image: mysql:5.7.11 environment: - MYSQL_ROOT_PASSWORD=root ports: - 3306 gateway: container_name: gateway image: golang:1.6.0-alpine volumes: - ./:/example working_dir: /example/gateway command: go run gateway.go environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=sandbox links: - mysql </code></pre> <p><strong>gateway/gateway.go</strong></p> <pre><code>package main import ( "database/sql" "encoding/json" "fmt" _ "github.com/go-sql-driver/mysql" "github.com/gorilla/mux" "net/http" "os" ) var db *sql.DB func main() { r := mux.NewRouter() var e error db, e = sql.Open( "mysql", os.ExpandEnv("root:${MYSQL_SERVER_PASSWORD}@mysql_server:3306/${MYSQL_DATABASE}")) fmt.Print("error is", e) r.HandleFunc("/todos", getTodos).Methods("GET") http.ListenAndServe(":8080", r) fmt.Printf("gateway") } type todo struct{} func getTodos(w http.ResponseWriter, r *http.Request) { t := new(todo) s, _ := json.Marshal(t) w.Header().Set("Content-Type", "application/json; charset=UTF-8") fmt.Fprint(w, string(s)) } </code></pre> <h2><br><br></h2> <p><strong>Update 1</strong> I changed my data-volume mount path inside the container to mount the project under the containers $GOPATH</p> <pre><code>mysql: container_name: mysql_server image: mysql:5.7.11 environment: - MYSQL_ROOT_PASSWORD=root ports: - 3306 gateway: container_name: gateway image: golang:1.6.0-alpine volumes: - ./:/go/src/github.com/cflynn07/golang-db-gateway-example working_dir: /go/src/github.com/cflynn07/golang-db-gateway-example command: go run gateway/gateway.go environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=sandbox links: - mysql </code></pre> <p>However now docker appears to hang:</p> <pre><code>~/g/s/g/c/golang-db-gateway-example git:master ❯❯❯ docker-compose up gateway ✱ mysql_server is up-to-date Recreating gateway Attaching to gateway </code></pre> </div>

无法使用golang docker sdk从docker容器获取日志

<div class="post-text" itemprop="text"> <p>I want to compile untrusted code in docker container, so I want to test exec command</p> <pre><code>import ( "context" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" log "github.com/sirupsen/logrus" "io" "os" ) func main() { dockerClient, err := client.NewClientWithOpts(client.WithVersion("1.38")) if err != nil{ log.Error("error when create dockerClient ",err) } ctx := context.Background() container, err := dockerClient.ContainerCreate(ctx,&amp;container.Config{ Image:"golang", OpenStdin:true, Tty:true, AttachStdin:true, Cmd:[]string{"bash"}, AttachStdout:true, AttachStderr:true, },nil,nil,"") if err := dockerClient.ContainerStart(ctx,container.ID,types.ContainerStartOptions{});err != nil{ log.Error("error when start container", err) return } idResponse, err :=dockerClient.ContainerExecCreate(ctx,container.ID,types.ExecConfig{ Cmd:[]string{"echo","hello"}, Tty:true, AttachStderr:true, AttachStdout:true, AttachStdin:true, Detach:true, }) if err := dockerClient.ContainerExecStart(ctx,idResponse.ID,types.ExecStartCheck{ }); err != nil{ log.Error("error when exec start ", err) } reader, err :=dockerClient.ContainerLogs(ctx,container.ID,types.ContainerLogsOptions{ ShowStdout:true, ShowStderr:true, }) if err != nil{ log.Error("error when containerLogs",err) } go io.Copy(os.Stdout,reader) &lt;- make(chan struct{}) </code></pre> <p>}</p> <p>as you can see, I create an new exec process, exec a new cmd called "echo hello", I want to get output from running container and show in my golang console. but not working, could you help me to solve? I try so many ways but not worked.</p> <p>and I also try to remove <code>dockerClient.ContainerLogs</code> block, replace with</p> <pre><code>conn, err :=dockerClient.ContainerAttach(ctx,container.ID,types.ContainerAttachOptions{ Stdout:true, Stderr:true, Stdin:true, Stream:true, Logs:true, }) go io.Copy(os.Stdout,conn.Reader) </code></pre> <p>but still cannot get logs from container. When I run above code, my console is empty, expected result is have "hello" in my console.</p> </div>

stdout被缓冲在docker容器中

<div class="post-text" itemprop="text"> <p>I'm not entirely sure what is going on here but it appears that stdout is being buffered when I run my code in a container, but not if I run it on the host or on OSX.</p> <p><a href="https://github.com/myles-mcdonnell/procwrap/blob/master/procwrap.go" rel="noreferrer">https://github.com/myles-mcdonnell/procwrap/blob/master/procwrap.go</a></p> <p>The relevant piece (modified for brevity):</p> <pre><code> cmd := exec.Command("ping", "127.0.0.1") logger := &amp;lumberjack.Logger{ Filename: conf.LogFile, MaxSize: conf.MaxLogSizeMb, MaxBackups: conf.MaxLogBackups, MaxAge: conf.MaxLogAgeDays, } cmd.Stdout = io.MultiWriter(os.Stdout, logger) err := cmd.Run() </code></pre> <p>Running in a container the sub process runs fine but I only see output (to stdout and the log file) at intervals, like a buffer is being flushed. Run it outside of a container and it outputs as it is generated. I'm using go 1.6.3. I see the same behaviour running the container interactively and in the background.</p> <p>Docker version:</p> <pre><code>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 version: 1.24 Go version: go1.6.3 Git commit: 8eab29e Built: Thu Jul 28 23:54:00 2016 OS/Arch: linux/amd64 </code></pre> <p>======= UPDATE ======</p> <p>I'm seeing different behaviour based on the base image. Running procwrap on a debian:wheezy base I get buffered output. Doing the same on ubuntu:trusty it's synchronous. Dockerfiles below, simply execute 'docker run {image_name}' on each to observe. Run procwrap on a wheezy VM (no docker involved) does not buffer the output.</p> <p>TRUSTY:</p> <pre><code>FROM ubuntu:trusty RUN apt-get update RUN apt-get install -y curl RUN apt-get install -y git RUN curl -O https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz RUN tar -xvf go1.6.3.linux-amd64.tar.gz RUN mv go /usr/local ENV GOROOT=/usr/local/go RUN mkdir -p /go/src/github.com/myles-mcdonnell ENV GOPATH=/go ENV PATH=$PATH:$GOPATH/bin:$GOROOT/bin RUN go get github.com/myles-mcdonnell/procwrap WORKDIR /go/src/github.com/myles-mcdonnell/procwrap CMD procwrap -v </code></pre> <p>WHEEZY:</p> <pre><code>FROM debian:wheezy RUN apt-get update RUN apt-get install -y curl RUN apt-get install -y git RUN curl -O https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz RUN tar -xvf go1.6.3.linux-amd64.tar.gz RUN mv go /usr/local ENV GOROOT=/usr/local/go RUN mkdir -p /go/src/github.com/myles-mcdonnell ENV GOPATH=/go ENV PATH=$PATH:$GOPATH/bin:$GOROOT/bin RUN go get github.com/myles-mcdonnell/procwrap WORKDIR /go/src/github.com/myles-mcdonnell/procwrap CMD procwrap -v </code></pre> </div>

无法在Docker容器中执行二进制文件,但从主机执行

<div class="post-text" itemprop="text"> <p>I have a docker container based on <code>composer:1.8</code>(based on <code>php:7-alpine</code>).</p> <p>Inside the container I download a <code>tar.gz</code> via php, decompress it and extract it which works fine. This contains a Go binary I want to execute. When executing the binary inside the docker container I get this error message: <code>./bin/&lt;binary&gt;: No such file or directory</code>. On my host machine I can execute this binary downloaded inside the docker container perfectly fine.</p> <p>If it is important I start the docker container with: <code>docker run -it --rm --volume=$PWD:/usr/src/myapp -u $(id -u):$(id -g) --name ec ec /bin/bash</code></p> <p>I also tried to run <code>readelf -a &lt;binary&gt;</code> after installing it, but that doesn't have any effect.</p> <pre><code>bash-4.4$ ls -l &lt;binary&gt; &amp;&amp; echo userid: $(id -u) &amp;&amp; echo groupid: $(id -g) &amp;&amp; uname -om &amp;&amp; ./&lt;binary&gt; -rwxr-xr-x 1 1000 985 7582050 Mar 15 17:09 &lt;binary&gt; userid: 1000 groupid: 985 x86_64 Linux bash: ./&lt;binary&gt;: No such file or directory </code></pre> <p>What can I do to make this work?</p> </div>

无法弄清楚如何使用Docker容器进行交叉编译

<div class="post-text" itemprop="text"> <p>I am trying to cross compile some Go code to a windows target (based on this guide <a href="https://hub.docker.com/_/golang/" rel="nofollow">https://hub.docker.com/_/golang/</a>):</p> <pre><code>$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 golang:1.5 go get github.com/gorilla/websocket &amp;&amp; go build -v conn.go:8:2: cannot find package "github.com/gorilla/websocket" in any of: /usr/lib/go/src/github.com/gorilla/websocket (from $GOROOT) /home/mark/devel/gocode/src/github.com/gorilla/websocket (from $GOPATH) </code></pre> <p>I try to compile this: <a href="https://github.com/gorilla/websocket/tree/master/examples/chat" rel="nofollow">https://github.com/gorilla/websocket/tree/master/examples/chat</a>) ...but I can not figure out the correct command line :(</p> </div>

为docker golang api在docker中设置容器的端口

<div class="post-text" itemprop="text"> <p>I am looking forward to do something below like this using docker golang api</p> <p>cmd : docker run -t -i -p 8989:8080 "image-name" /bin/bash</p> <p>Also I am using golang sdk <a href="https://github.com/moby/moby/client" rel="nofollow noreferrer">https://github.com/moby/moby/client</a> or <a href="https://godoc.org/github.com/moby/moby/client" rel="nofollow noreferrer">https://godoc.org/github.com/moby/moby/client</a> and my docker api version is 1.30 (Client &amp; Server both)</p> <p>Here is the piece of code I am using</p> <pre><code> package main import ( "fmt" "github.com/docker/docker/client" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "golang.org/x/net/context" "github.com/docker/go-connections/nat" //"github.com/docker/docker/vendor/github.com/docker/go-connections/nat" ) func check(err error) { if err != nil { panic(err) } } func main(){ ctx := context.Background() cli, err := client.NewEnvClient() check(err) config := &amp;container.Config{ Image : image-name, ExposedPorts: nat.PortSet{ "8080/tcp": struct{}{}, }, Cmd : [] string {"sh","-c","while true; do sleep always; done","/bin/bash"}, } host_config := &amp;container.HostConfig{ PortBindings: nat.PortMap{ "8080/tcp": []nat.PortBinding{ { HostIP: "0.0.0.0", HostPort: "8989", }, }, }, } resp, err := cli.ContainerCreate(ctx,config,host_config, nil,"") check(err) if err := cli.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{}); err != nil { panic(err) } } </code></pre> <p>After Compiling this code I get the following error</p> <pre><code># command-line-arguments src\main\createcontainer1.go:53: cannot use "github.com/docker/go-connections/nat".PortSet literal (type "github.com/docker/go-connections/nat".PortSet) as type "github.com/docker/docker/vendor/github.com/docker/go-connections/nat".PortSet in field value src\main\createcontainer1.go:65: cannot use "github.com/docker/go-connections/nat".PortMap literal (type "github.com/docker/go-connections/nat".PortMap) as type "github.com/docker/docker/vendor/github.com/docker/go-connections/nat".PortMap in field value </code></pre> <p>If somebody knows what could be the problem and how to fix it. Please answer to it as I am beginner with docker. </p> </div>

在Docker容器中部署Golang应用程序

<div class="post-text" itemprop="text"> <p>i need to deploy go restful app into Docker container.</p> <p>My project has the following structure</p> <p>go_proj </p> <blockquote> <pre><code> |- bin |- src | | |- com.example | | | |- web_service.go | | | |- github.com.gorilla.mux | | | - ... |- Dockerfile </code></pre> </blockquote> <p>How should my Dockerfile look like? And maybe I should download the library(mux) from the container?</p> </div>

我如何才能适当地供应商github.com/docker/docker?

<div class="post-text" itemprop="text"> <p>here my main.go</p> <pre><code>package cmd import ( "context" "fmt" "github.com/docker/docker/api/types" "github.com/docker/docker/client" ) func main() { cli, err := client.NewClientWithOpts(client.WithVersion("1.38")) if err != nil { panic(err) } networks, err := cli.NetworkList(context.Background(), types.NetworkListOptions{}) if err != nil { panic(err) } fmt.Println(networks) } </code></pre> <p>i tried to run <code>dep init</code> but vendor folder ended up with an older version of docker/docker because the newest tag is 17.05 tried to pin the actual commit but that did not work either</p> <p>i give a shot to <code>go mod vendor</code> but that also rely on git tags</p> <p>Strangely enough docker/docker is an alias to moby/moby and docker/engine.</p> <p>Anyone could explain me and give example how can i successfully use vendoring with docker API?</p> </div>

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

实现简单的文件系统

实验内容: 通过对具体的文件存储空间的管理、文件的物理结构、目录结构和文件操作的实现,加深对文件系统内部功能和实现过程的理解。 要求: 1.在内存中开辟一个虚拟磁盘空间作为文件存储器,在其上实现一个简

MIPS单周期CPU-组成原理实验-华中科技大学

使用logisim布线完成的MIPS单周期CPU,可支持28条指令。跑马灯的代码已经装入了寄存器,可以直接开启时钟运行。

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

基于QT和OpenCV的五子棋实现源码

一个简单的五子棋应用,基于QT和OpenCV的实现源码,通过相邻棋子判断是否获胜,不包含人工智能算法,适合新手入门

Git 实用技巧

这几年越来越多的开发团队使用了Git,掌握Git的使用已经越来越重要,已经是一个开发者必备的一项技能;但很多人在刚开始学习Git的时候会遇到很多疑问,比如之前使用过SVN的开发者想不通Git提交代码为什么需要先commit然后再去push,而不是一条命令一次性搞定; 更多的开发者对Git已经入门,不过在遇到一些代码冲突、需要恢复Git代码时候就不知所措,这个时候哪些对 Git掌握得比较好的少数人,就像团队中的神一样,在队友遇到 Git 相关的问题的时候用各种流利的操作来帮助队友于水火。 我去年刚加入新团队,发现一些同事对Git的常规操作没太大问题,但对Git的理解还是比较生疏,比如说分支和分支之间的关联关系、合并代码时候的冲突解决、提交代码前未拉取新代码导致冲突问题的处理等,我在协助处理这些问题的时候也记录各种问题的解决办法,希望整理后通过教程帮助到更多对Git操作进阶的开发者。 本期教程学习方法分为“掌握基础——稳步进阶——熟悉协作”三个层次。从掌握基础的 Git的推送和拉取开始,以案例进行演示,分析每一个步骤的操作方式和原理,从理解Git 工具的操作到学会代码存储结构、演示不同场景下Git遇到问题的不同处理方案。循序渐进让同学们掌握Git工具在团队协作中的整体协作流程。 在教程中会通过大量案例进行分析,案例会模拟在工作中遇到的问题,从最基础的代码提交和拉取、代码冲突解决、代码仓库的数据维护、Git服务端搭建等。为了让同学们容易理解,对Git简单易懂,文章中详细记录了详细的操作步骤,提供大量演示截图和解析。在教程的最后部分,会从提升团队整体效率的角度对Git工具进行讲解,包括规范操作、Gitlab的搭建、钩子事件的应用等。 为了让同学们可以利用碎片化时间来灵活学习,在教程文章中大程度降低了上下文的依赖,让大家可以在工作之余进行学习与实战,并同时掌握里面涉及的Git不常见操作的相关知识,理解Git工具在工作遇到的问题解决思路和方法,相信一定会对大家的前端技能进阶大有帮助。

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

linux“开发工具三剑客”速成攻略

工欲善其事,必先利其器。Vim+Git+Makefile是Linux环境下嵌入式开发常用的工具。本专题主要面向初次接触Linux的新手,熟练掌握工作中常用的工具,在以后的学习和工作中提高效率。

JAVA初级工程师面试36问(完结)

第三十一问: 说一下线程中sleep()和wait()区别? 1 . sleep()是让正在执行的线程主动让出CPU,当时间到了,在回到自己的线程让程序运行。但是它并没有释放同步资源锁只是让出。 2.wait()是让当前线程暂时退让出同步资源锁,让其他线程来获取到这个同步资源在调用notify()方法,才会让其解除wait状态,再次参与抢资源。 3. sleep()方法可以在任何地方使用,而wait()只能在同步方法或同步块使用。 ...

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

智鼎(附答案).zip

并不是完整题库,但是有智鼎在线2019年9、10、11三个月的试题,有十七套以上题目,普通的网申行测题足以对付,可以在做题时自己总结一些规律,都不是很难

Visual Assist X 破解补丁

vs a's'sixt插件 支持vs2008-vs2019 亲测可以破解,希望可以帮助到大家

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

JavaWEB商城项目(包括数据库)

功能描述:包括用户的登录注册,以及个人资料的修改.商品的分类展示,详情,加入购物车,生成订单,到银行支付等!另外还有收货地址的和我的收藏等常用操作.环境(JDK 1.7 ,mysql 5.5,Ecli

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

一学即懂的计算机视觉(第一季)

图像处理和计算机视觉的课程大家已经看过很多,但总有“听不透”,“用不了”的感觉。课程致力于创建人人都能听的懂的计算机视觉,通过生动、细腻的讲解配合实战演练,让学生真正学懂、用会。 【超实用课程内容】 课程内容分为三篇,包括视觉系统构成,图像处理基础,特征提取与描述,运动跟踪,位姿估计,三维重构等内容。课程理论与实战结合,注重教学内容的可视化和工程实践,为人工智能视觉研发及算法工程师等相关高薪职位就业打下坚实基础。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/26281 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,但是大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录https://edu.csdn.net/course/detail/26281,点击右下方课程资料、代码、课件等打包下载

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

2019 Python开发者日-培训

本次活动将秉承“只讲技术,拒绝空谈”的理念,邀请十余位身处一线的Python技术专家,重点围绕Web开发、自动化运维、数据分析、人工智能等技术模块,分享真实生产环境中使用Python应对IT挑战的真知灼见。此外,针对不同层次的开发者,大会还安排了深度培训实操环节,为开发者们带来更多深度实战的机会。

快速入门Android开发 视频 教程 android studio

这是一门快速入门Android开发课程,顾名思义是让大家能快速入门Android开发。 学完能让你学会如下知识点: Android的发展历程 搭建Java开发环境 搭建Android开发环境 Android Studio基础使用方法 Android Studio创建项目 项目运行到模拟器 项目运行到真实手机 Android中常用控件 排查开发中的错误 Android中请求网络 常用Android开发命令 快速入门Gradle构建系统 项目实战:看美图 常用Android Studio使用技巧 项目签名打包 如何上架市场

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

相关热词 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行 c# 循环给数组插入数据 c# 多线程死锁的例子 c# 钉钉读取员工排班 c# label 不显示 c#裁剪影像 c#工作进程更新ui
立即提问