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/cio"
|
||||||
"github.com/containerd/containerd/contrib/seccomp"
|
"github.com/containerd/containerd/contrib/seccomp"
|
||||||
"github.com/containerd/containerd/oci"
|
"github.com/containerd/containerd/oci"
|
||||||
|
refdocker "github.com/containerd/containerd/reference/docker"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
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)
|
ctxWithTimeout, cancel := context.WithTimeout(d.ctxContainerd, 90*time.Second)
|
||||||
defer cancel()
|
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) {
|
func (d *Driver) createContainer(containerConfig *ContainerConfig, config *TaskConfig) (containerd.Container, error) {
|
||||||
|
@ -6,7 +6,7 @@ job "capabilities" {
|
|||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "docker.io/library/ubuntu:16.04"
|
image = "ubuntu:16.04"
|
||||||
command = "sleep"
|
command = "sleep"
|
||||||
args = ["600s"]
|
args = ["600s"]
|
||||||
readonly_rootfs = true
|
readonly_rootfs = true
|
||||||
|
@ -15,7 +15,7 @@ job "dns" {
|
|||||||
task "dns-task" {
|
task "dns-task" {
|
||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
config {
|
config {
|
||||||
image = "docker.io/library/ubuntu:16.04"
|
image = "ubuntu:16.04"
|
||||||
command = "sleep"
|
command = "sleep"
|
||||||
args = ["600s"]
|
args = ["600s"]
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ job "extra_hosts" {
|
|||||||
task "extra_hosts-task" {
|
task "extra_hosts-task" {
|
||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
config {
|
config {
|
||||||
image = "docker.io/library/ubuntu:16.04"
|
image = "ubuntu:16.04"
|
||||||
extra_hosts = ["postgres:127.0.1.1", "redis:127.0.1.2"]
|
extra_hosts = ["postgres:127.0.1.1", "redis:127.0.1.2"]
|
||||||
host_network = true
|
host_network = true
|
||||||
command = "sleep"
|
command = "sleep"
|
||||||
|
@ -6,7 +6,7 @@ job "hello" {
|
|||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "docker.io/shm32/hello:world"
|
image = "shm32/hello:world"
|
||||||
}
|
}
|
||||||
|
|
||||||
resources {
|
resources {
|
||||||
|
@ -6,7 +6,7 @@ job "privileged" {
|
|||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "docker.io/library/ubuntu:16.04"
|
image = "ubuntu:16.04"
|
||||||
command = "sleep"
|
command = "sleep"
|
||||||
args = ["600s"]
|
args = ["600s"]
|
||||||
privileged = true
|
privileged = true
|
||||||
|
@ -6,7 +6,7 @@ job "redis" {
|
|||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "docker.io/library/redis:alpine"
|
image = "redis:alpine"
|
||||||
seccomp = true
|
seccomp = true
|
||||||
cwd = "/home/redis"
|
cwd = "/home/redis"
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ job "signal" {
|
|||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "docker.io/shm32/signal_handler:1.0"
|
image = "shm32/signal_handler:1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
resources {
|
resources {
|
||||||
|
@ -6,7 +6,7 @@ job "stress" {
|
|||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "docker.io/shm32/stress:1.0"
|
image = "shm32/stress:1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
restart {
|
restart {
|
||||||
|
@ -18,7 +18,7 @@ job "volume_mount" {
|
|||||||
task "volume_mount-task" {
|
task "volume_mount-task" {
|
||||||
driver = "containerd-driver"
|
driver = "containerd-driver"
|
||||||
config {
|
config {
|
||||||
image = "docker.io/library/ubuntu:16.04"
|
image = "ubuntu:16.04"
|
||||||
command = "sleep"
|
command = "sleep"
|
||||||
args = ["600s"]
|
args = ["600s"]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user