mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-09 17:20:39 +00:00
first attempt at rancher/docker
This commit is contained in:
parent
678550e68f
commit
d29a26fa53
14
Dockerfile
14
Dockerfile
@ -2,20 +2,8 @@
|
||||
#
|
||||
# docker build --rm=true -t plugins/drone-docker .
|
||||
|
||||
FROM ubuntu:14.04
|
||||
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get -y install curl \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
lxc \
|
||||
iptables \
|
||||
&& curl -sSL https://get.docker.com/ubuntu/ | sh \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
FROM rancher/docker
|
||||
|
||||
ADD drone-docker /go/bin/
|
||||
ADD wrapdocker /bin/
|
||||
|
||||
VOLUME /var/lib/docker
|
||||
ENTRYPOINT ["/go/bin/drone-docker"]
|
||||
|
21
main.go
21
main.go
@ -51,12 +51,8 @@ func main() {
|
||||
|
||||
// Starts the Docker daemon
|
||||
go func() {
|
||||
cmd := exec.Command("/bin/bash", "/bin/wrapdocker")
|
||||
cmd.Stdout = ioutil.Discard
|
||||
cmd.Stderr = ioutil.Discard
|
||||
cmd.Run()
|
||||
|
||||
args := []string{"daemon", "-s", vargs.Storage}
|
||||
args := []string{"/usr/bin/docker", "-d", "-s", vargs.Storage}
|
||||
|
||||
if vargs.Insecure && len(vargs.Registry) != 0 {
|
||||
args = append(args, "--insecure-registry", vargs.Registry)
|
||||
@ -66,15 +62,22 @@ func main() {
|
||||
args = append(args, "--dns", value)
|
||||
}
|
||||
|
||||
cmd = exec.Command("docker", args...)
|
||||
cmd.Stdout = ioutil.Discard
|
||||
cmd.Stderr = ioutil.Discard
|
||||
cmd := exec.Command("/usr/bin/dockerlaunch", args...)
|
||||
if os.Getenv("DOCKER_LAUNCH_DEBUG") == "true" {
|
||||
cmd.Env = os.Environ()
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
} else {
|
||||
cmd.Stdout = ioutil.Discard
|
||||
cmd.Stderr = ioutil.Discard
|
||||
}
|
||||
|
||||
trace(cmd)
|
||||
cmd.Run()
|
||||
}()
|
||||
|
||||
// Sleep for a few seconds
|
||||
time.Sleep(5 * time.Second)
|
||||
time.Sleep(35 * time.Second)
|
||||
|
||||
// Set the Registry value
|
||||
if len(vargs.Registry) == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user