modify example

Signed-off-by: Yang Keao <keao.yang@yahoo.com>
This commit is contained in:
Yang Keao 2020-12-28 13:44:36 +08:00
parent c2dc371576
commit 6a8a6d46c7
4 changed files with 6 additions and 7 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
/target
/example/toda
/toda

View File

@ -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

View File

@ -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"]

View File

@ -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)