1
0
mirror of https://github.com/peterbourgon/runsvinit.git synced 2024-12-16 14:57:04 +00:00

zombietest: build container

This commit is contained in:
Peter Bourgon 2015-09-28 12:25:44 +02:00
parent 692c29d543
commit 05fe1d1fa6
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,9 @@
FROM golang:1.5.1
COPY ../../*.go /go/src/github.com/peterbourgon/runsvinit
RUN go install -v github.com/peterbourgon/runsvinit
RUN mv /go/bin/runsvinit /mount/
COPY zombie.c /
RUN cc -Wall -Werror -o /zombie /zombie.c
RUN mv /zombie /mount/

View File

@ -0,0 +1,9 @@
.PHONY: all
all: zombie runsvinit
zombie runsvinit: .uptodate
docker run -ti --rm -v $(shell pwd):/mount zombie-build
.uptodate: Dockerfile ../../*.go
docker build -t zombie-build .
touch $@

18
zombietest/build/zombie.c Normal file
View File

@ -0,0 +1,18 @@
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main ()
{
pid_t child_pid;
child_pid = fork ();
if (child_pid > 0) {
sleep (60);
}
else {
exit (0);
}
return 0;
}