diff --git a/.gitignore b/.gitignore index ea8c4bf..46b76ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /target +/example/toda +/toda \ No newline at end of file diff --git a/Makefile b/Makefile index 0c5cd02..a7c18bd 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,15 @@ -example-image: +example-image: image docker build -t io-example ./example volume: docker volume create io-example example: example-image volume - docker run --ulimit nofile=5000:5000 -v io-example:/var/run/test -v /tmp:/tmp -it io-example /main-app + docker run --privileged --ulimit nofile=5000:5000 -v io-example:/var/run/test -v /tmp:/tmp -it io-example /main-app debug: cargo build -example-inject:debug - cat ./io-inject-example.json|sudo ./target/debug/toda --path /var/run/test --pid $$(pgrep main-app) --verbose trace - image: DOCKER_BUILDKIT=1 docker build --build-arg HTTP_PROXY=${HTTP_PROXY} --build-arg HTTPS_PROXY=${HTTPS_PROXY} . -t chaos-mesh/toda diff --git a/example/Dockerfile b/example/Dockerfile index 7602cc4..24a96cc 100644 --- a/example/Dockerfile +++ b/example/Dockerfile @@ -7,7 +7,7 @@ RUN go get -d -v ./... RUN go build -o /go/bin/app -FROM alpine:3.12 +FROM chaos-mesh/toda COPY --from=build-env /go/bin/app / COPY --from=build-env /go/bin/app /main-app CMD ["/app"] diff --git a/example/example.go b/example/example.go index c069311..985c243 100644 --- a/example/example.go +++ b/example/example.go @@ -72,7 +72,7 @@ func main() { } } - time.Sleep(time.Microsecond) + time.Sleep(time.Second) buf := make([]byte, originalLength+len(count)) n, err := f.Read(buf)