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:
parent
692c29d543
commit
05fe1d1fa6
9
zombietest/build/Dockerfile
Normal file
9
zombietest/build/Dockerfile
Normal 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/
|
9
zombietest/build/Makefile
Normal file
9
zombietest/build/Makefile
Normal 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
18
zombietest/build/zombie.c
Normal 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user