Closed cbl closed 2 years ago
Hi,
as specified in the task, the input must be read from stdin and the output must be written to stdout. There is no such thing as an input file.
See https://github.com/informatiCup/informatiCup2022/issues/2 for more information on stdin.
I wish you and all participants a happy x-mas.
Hi,
building up on that issue I was wondering how can I "simulate" on my local machine what the CI is doing? Using the docker run command shown above, the docker image I built before can be run. Unfortunately I don't understand how to pass content using the standard input. The program is written in C++ and expects content via "cin", which works fine using the command line. Do you have any ideas?
Thanks a lot in advance!
Hi,
just pipe the content of the input file into the docker command. Here are some examples.
cat INPUT_FILE.txt | docker run -{additional flags} {Container}
docker run -i {additional flags} {Container} < INPUT_FILE.txt
Get-Content INPUT_FILE.txt | docker run -i {additional flags} {Container}
@Top-Ranger thank you for the quick reply. I confused the standard input with a terminal argument...
Merry Christmas from my side as well! :)
@Top-Ranger also thanks for the quick reply, it worked!
It seems to me that the input argument is missing in the CI system. The web interface shows that the following arguments are passed to the
docker run
command:so the
reducted
arguments are the name of the container and the tag of the build, the third[redacted]
should be the input or am i missing something here?When I am running the same command with the input after all those arguments it works just fine.
My docker image runs a
run.sh
as an entry point usingENTRYPOINT
like pointed out in stackoverflow.com/a/40312311, which has the following content: