Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
(
# Clean-up from previous run
kubectl delete rc app
kubectl delete secret creds
kubectl delete ServiceBroker mongodb-sb
kubectl delete ServiceInstance mongodb-instance1
kubectl delete ServiceBinding mongodb-instance1-binding1
kubectl delete thirdpartyresource service-broker.cncf.org
Simple case - no hooks, etc:
runc create --name=test --process=myapp
or if you need hooks, etc... :
runc create --name=test
# process is just "sleep"
# creates a new container will all new NSs
# do pre-start hooks here
package client
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"strings"
"testing"
---> Making bundle: dynbinary (in bundles/1.10.0-dev/dynbinary)
Created binary: bundles/1.10.0-dev/dynbinary/dockerinit-1.10.0-dev
Building: bundles/1.10.0-dev/dynbinary/docker-1.10.0-dev
Created binary: bundles/1.10.0-dev/dynbinary/docker-1.10.0-dev
---> Making bundle: test-integration-cli (in bundles/1.10.0-dev/test-integration-cli)
---> Making bundle: .integration-daemon-start (in bundles/1.10.0-dev/test-integration-cli)
+++ /etc/init.d/apparmor start
* Starting AppArmor profiles
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
# ./runc exec --help
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4a561d]
goroutine 1 [running]:
github.com/codegangsta/cli.(*StringSlice).String(0x0, 0x0, 0x0)
/root/src/github.com/opencontainers/runc2/Godeps/_workspace/src/github.com/codegangsta/cli/flag.go:110 +0x11d
flag.(*FlagSet).Var(0xc8200ba0c0, 0x7feb60aa6408, 0x0, 0x7cba98, 0x3, 0x821220, 0x19)
/usr/local/go/src/flag/flag.go:766 +0x6e
github.com/codegangsta/cli.StringSliceFlag.Apply.func1(0x7cba98, 0x3)
diff --git a/libcontainer/standard_init_linux.go b/libcontainer/standard_init_li
index ec10057..7230f0f 100644
--- a/libcontainer/standard_init_linux.go
+++ b/libcontainer/standard_init_linux.go
@@ -109,5 +109,11 @@ func (l *linuxStandardInit) Init() error {
if syscall.Getppid() != l.parentPid {
return syscall.Kill(syscall.Getpid(), syscall.SIGKILL)
}
+
+ // Special case - just sleep forever
func (s *DockerDaemonSuite) TestDaemonNoColors(c *check.C) {
testRequires(c, SameHostDaemon, DaemonIsLinux)
pty, tty, err := pty.Open()
c.Assert(err, check.IsNil)
cmd := exec.Command(dockerBinary, "daemon", "--no-color")
cmd.Stdin = tty
cmd.Stdout = tty
cmd.Stderr = tty
c.Assert(cmd.Start(), check.IsNil)
package api
...
func ResolveVersion() string {
version := "1.21"
if tmp := os.Getenv("DOCKER_API_VERSION"); tmp != "" {
version = tmp
}
diff --git a/daemon/daemon.go b/daemon/daemon.go
index 6a8d18e..f82bcdb 100644
--- a/daemon/daemon.go
+++ b/daemon/daemon.go
@@ -1236,6 +1236,10 @@ func (daemon *Daemon) ImageHistory(name string) ([]*types
// GetImageID returns an image ID corresponding to the image referred to by
// refOrID.
func (daemon *Daemon) GetImageID(refOrID string) (image.ID, error) {
+ if i := strings.Index(refOrID, ":"); i >= 0 {
+ refOrID = refOrID[i+1:]
$ docker rmi sha256:7b521
Error response from daemon: unrecognized image ID sha256:7b521
Error: failed to remove images: [sha256:7b521]
$ docker rmi 7b521
Deleted: sha256:7b521c3b64737ed5e5fe1b92c451a980fea823e6af8b020979a26fc09582b977
Deleted: sha256:94c29bb0663a983ac21bd7b4c9b6d18977a2cc16eaba846fa9d58738d118680c