Set default docker registry.
This commit is contained in:
parent
dc2f547ea5
commit
e4ead0dea3
@ -29,6 +29,7 @@ import (
|
||||
"github.com/containerd/containerd/cio"
|
||||
"github.com/containerd/containerd/contrib/seccomp"
|
||||
"github.com/containerd/containerd/oci"
|
||||
refdocker "github.com/containerd/containerd/reference/docker"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
)
|
||||
|
||||
@ -66,7 +67,12 @@ func (d *Driver) pullImage(imageName string) (containerd.Image, error) {
|
||||
ctxWithTimeout, cancel := context.WithTimeout(d.ctxContainerd, 90*time.Second)
|
||||
defer cancel()
|
||||
|
||||
return d.client.Pull(ctxWithTimeout, imageName, containerd.WithPullUnpack)
|
||||
named, err := refdocker.ParseDockerRef(imageName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return d.client.Pull(ctxWithTimeout, named.String(), containerd.WithPullUnpack)
|
||||
}
|
||||
|
||||
func (d *Driver) createContainer(containerConfig *ContainerConfig, config *TaskConfig) (containerd.Container, error) {
|
||||
|
@ -6,7 +6,7 @@ job "capabilities" {
|
||||
driver = "containerd-driver"
|
||||
|
||||
config {
|
||||
image = "docker.io/library/ubuntu:16.04"
|
||||
image = "ubuntu:16.04"
|
||||
command = "sleep"
|
||||
args = ["600s"]
|
||||
readonly_rootfs = true
|
||||
|
@ -15,7 +15,7 @@ job "dns" {
|
||||
task "dns-task" {
|
||||
driver = "containerd-driver"
|
||||
config {
|
||||
image = "docker.io/library/ubuntu:16.04"
|
||||
image = "ubuntu:16.04"
|
||||
command = "sleep"
|
||||
args = ["600s"]
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ job "extra_hosts" {
|
||||
task "extra_hosts-task" {
|
||||
driver = "containerd-driver"
|
||||
config {
|
||||
image = "docker.io/library/ubuntu:16.04"
|
||||
image = "ubuntu:16.04"
|
||||
extra_hosts = ["postgres:127.0.1.1", "redis:127.0.1.2"]
|
||||
host_network = true
|
||||
command = "sleep"
|
||||
|
@ -6,7 +6,7 @@ job "hello" {
|
||||
driver = "containerd-driver"
|
||||
|
||||
config {
|
||||
image = "docker.io/shm32/hello:world"
|
||||
image = "shm32/hello:world"
|
||||
}
|
||||
|
||||
resources {
|
||||
|
@ -6,7 +6,7 @@ job "privileged" {
|
||||
driver = "containerd-driver"
|
||||
|
||||
config {
|
||||
image = "docker.io/library/ubuntu:16.04"
|
||||
image = "ubuntu:16.04"
|
||||
command = "sleep"
|
||||
args = ["600s"]
|
||||
privileged = true
|
||||
|
@ -6,7 +6,7 @@ job "redis" {
|
||||
driver = "containerd-driver"
|
||||
|
||||
config {
|
||||
image = "docker.io/library/redis:alpine"
|
||||
image = "redis:alpine"
|
||||
seccomp = true
|
||||
cwd = "/home/redis"
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ job "signal" {
|
||||
driver = "containerd-driver"
|
||||
|
||||
config {
|
||||
image = "docker.io/shm32/signal_handler:1.0"
|
||||
image = "shm32/signal_handler:1.0"
|
||||
}
|
||||
|
||||
resources {
|
||||
|
@ -6,7 +6,7 @@ job "stress" {
|
||||
driver = "containerd-driver"
|
||||
|
||||
config {
|
||||
image = "docker.io/shm32/stress:1.0"
|
||||
image = "shm32/stress:1.0"
|
||||
}
|
||||
|
||||
restart {
|
||||
|
@ -18,7 +18,7 @@ job "volume_mount" {
|
||||
task "volume_mount-task" {
|
||||
driver = "containerd-driver"
|
||||
config {
|
||||
image = "docker.io/library/ubuntu:16.04"
|
||||
image = "ubuntu:16.04"
|
||||
command = "sleep"
|
||||
args = ["600s"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user