Open Mrinank-Bhowmick opened 1 year ago
If your question is what is to be done for using restler once you are in the container, you can run ./Restler compile --api_spec swagger.json
after importing a json in the container
it's not working for me...
first i tried : chmod +x RESTler/restler/Restler.exe
and got this error :
<3>WSL (13) ERROR: UtilGetPpid:1293: Failed to parse: /proc/1/stat, content: 1 (sh) S 0 1 1 34816 13 4194560 529 276 0 0 0 1 0 0 20 0 1 0 2534910 1712128 277 18446744073709551615 94786931576832 94786932214462 140736819780704 0 0 0 0 2637828 65538 1 0 0 17 2 0 0 0 0 0 94786932357152 94786932371504 94786948694016 140736819785446 140736819785454 140736819785454 140736819785712 0
as #838
This also happens to me.
I had to change the Dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine as builder
RUN apk add --no-cache python3 py3-pip
COPY src ./src
COPY restler ./restler
COPY build-restler.py .
RUN python3 build-restler.py --dest_dir /build
RUN python3 -m compileall -b /build/engine
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine as target
RUN apk add --no-cache python3 py3-pip
// this doesnt change anything
- RUN pip3 install requests applicationinsights
COPY --from=builder /build /RESTler
+ ENTRYPOINT [ "/RESTler/restler/Restler" ]
+ WORKDIR /mnt
You can use it also by mounting a volume to the container so that you dont have to copy the grammar.
# You dont need to set network to host but its helpful if you wanna later test in other network
docker run --rm -v ${PWD}:/mnt --network="host" -it restler compile --api_spec spec.yaml
# For other commands do
docker run --rm -v ${PWD}:/mnt --network="host" -it restler --help
This has the disadvantage that you cannot continue a test you started before. I dont know if that is even possible but yeah.
Description
Now what to do next as Restler wont run on conatiners?
And I want to improve the documentation for setting this up on docker and updating this file and section https://github.com/microsoft/restler-fuzzer#docker