New to Docker, I have written a code that reads a CSV file and converts it into JSON. It is working fine.
I follow the below procedure and get a PHP CLI image from the link https://hub.docker.com/_/php
Follow the instructions it shows me the "Completed" which is output from a file, but how can I get the generated file. Where the file will be?
Code for DockerFile
FROM php:7.4-cli
COPY . /challenge
WORKDIR challenge
CMD [ "php", "code.php" ]
Code for code.php
$file = fopen("./input/source.csv", 'r');
$json = array();
while ($row = fgetcsv($file,"1024",",")) {
array_push($json,$row);
}
fclose($file);
file_put_contents("./output/json/target.json", json_encode($json));
echo "Completed";
My operating system is Windows.