Skip to content

Instantly share code, notes, and snippets.

time="2015-06-12T01:05:31Z" level=info msg="redis not configured" instance.id=7267d8ea-f531-4765-9d22-c77c5426d24b version=v2.0.0-242-g01f730a.m
time="2015-06-12T01:05:31Z" level=debug msg="configured \"htpasswd\" access controller"
time="2015-06-12T01:05:31Z" level=info msg="listening on 127.0.0.1:1000"
time="2015-06-12T01:05:31Z" level=info msg="Starting upload purge in 24m0s" instance.id=7267d8ea-f531-4765-9d22-c77c5426d24b version=v2.0.0-242-g01f730a.m
time="2015-06-12T01:05:39Z" level=debug msg="authorizing request" http.request.host="127.0.0.1:1000" http.request.id=2ee407df-962b-48cf-8008-400dde4c2333 http.request.method=GET http.request.remoteaddr="127.0.0.1:52337" http.request.uri="/v2/" http.request.useragent="curl/7.38.0"
time="2015-06-12T01:05:39Z" level=error msg="error authorizing context: basic authentication challenge: &htpasswd.challenge{realm:\"basic-realm\", err:(*errors.errorString)(0xc20802b640)}" http.request.host="127.0.0.1:1000" http.request.id=2ee407df-962b-48cf-8008-400dde4c2333 http.
$ docker run -it golang bash
root@40465859a7eb:/go# # I added some code that uses logrus's WithFields which is only available starting from v0.3.0
root@40465859a7eb:/go/src/test# echo $GOPATH
/go
root@40465859a7eb:/go/src/test# go get github.com/Sirupsen/logrus
root@40465859a7eb:/go/src/test# ls -la
total 12
drwxr-xr-x 2 root root 4096 Jun 10 14:33 .
drwxrwxrwx 4 root root 4096 Jun 10 14:34 ..
-rw-r--r-- 1 root root 129 Jun 10 14:34 main.go
@tiborvass
tiborvass / gist:c80fd9e7066ddc5f267a
Last active August 29, 2015 14:22
I can't use Godep
MacBook-Pro:helloworld tibor$ echo $GOPATH
/Users/tibor/go
MacBook-Pro:helloworld tibor$ pwd
/Users/tibor/go/src/github.com/tiborvass/helloworld
MacBook-Pro:helloworld tibor$ ls -la
total 8
drwxr-xr-x 3 tibor staff 102 Jun 10 09:42 .
drwxr-xr-x 19 tibor staff 646 Jun 10 09:40 ..
-rw-r--r-- 1 tibor staff 104 Jun 10 09:42 main.go
MacBook-Pro:helloworld tibor$ cat main.go
s := certPool.Subjects()
subjects := make([]string, len(s))
for i, subject := range s {
subjects[i] = string(subject)
}
logrus.Debugf("Trusting certs with subjects: %v", subjects)
- doClientAuth := options.CertFile != "" && options.KeyFile != ""
- if doClientAuth {
- if !enforceClientAuth {
- _, errCert := os.Stat(options.CertFile)
- _, errKey := os.Stat(options.KeyFile)
- if errCert != nil || errKey != nil {
- return &tlsConfig, nil
- }
- }
- tlsCert, err := tls.LoadX509KeyPair(options.CertFile, options.KeyFile)
$ TESTFLAGS='-v -check.v -check.f TestDaemonICCPing|TestRunWithBlkioWeight|TestRunDeviceDirectory|TestNetworkNat|TestImportBadURL' make test-integration-cli
...
---> Making bundle: binary (in bundles/1.7.0-rc1/binary)
Building: /go/src/github.com/docker/docker/bundles/1.7.0-rc1/binary/docker-1.7.0-rc1
Created binary: /go/src/github.com/docker/docker/bundles/1.7.0-rc1/binary/docker-1.7.0-rc1
---> Making bundle: test-integration-cli (in bundles/1.7.0-rc1/test-integration-cli)
+ go test -check.f TestContainerApiRestartNotimeoutParam|TestImportBadURL|TestExecWithPrivileged|TestNetworkNat|TestPostContainerStop|TestRunCapAddALLCanDownInterface|TestRunDeviceDirectory|TestRunPrivilegedCanMknod|TestRunPrivilegedCanMount|TestRunProcWritableInPrivilegedContainers|TestRunSysWritableInPrivilegedContainers|TestRunWithBlkioWeight|TestTopPrivileged|TestDaemonICCPing -test.timeout=30m github.com/docker/docker/integration-cli
DockerSuite.TestContainerApiRestartNotimeoutParam 0.35
----------------------------------------------------------------------
FAIL: docker_api_containers_test.go:1001: DockerSuite.TestContainerApiRestartNotimeoutParam
docker_api_containers_test.go:1012:
c.Assert(status, check.Equals, http.StatusNoContent)
... obtained int = 500
... expected int = 204
FAIL: docker_cli_build_test.go:1215: DockerSuite.TestBuildAddSingleFileToNonExistingDir
docker_cli_build_test.go:1235:
c.Fatal(err)
... Error: failed to build the image: Sending build context to Docker daemon 3.072 kB
Sending build context to Docker daemon
Step 0 : FROM busybox
root@a4a1c9ecb48d:/go/src/github.com/docker/docker# go test ./registry
== START HTTPDUMP: deepest for insecure ==
GET /v2/ HTTP/1.1
Host: 127.0.0.1:42051
User-Agent: Go 1.1 package http
Accept-Encoding: gzip
== END HTTPDUMP: deepest for insecure ==
== START HTTPDUMP: deepest for insecure ==
package registry
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"