- Running the given commandsy:
docker pull infracloudio/csvserver:latest docker pull prom/prometheus:v2.45.2
-
Creating a gencsv.sh file to generate the inputFile
#!/bin/bash start_index=2 end_index=8 > inputFile # Generate entries and append them to inputFile for ((i=start_index; i<=end_index; i++)); do rand_num=$(shuf -i 1-1000 -n 1) # Generate a random number between 1 and 1000 echo "$i, $rand_num" >> inputFile done echo "File 'inputFile' generated with entries from $start_index to $end_index." e
-
Command to run the gencsv.sh file and creating a inputFile
chmod +x gencsv.sh
-
This Command will creating a inputFile
./gencsv.sh 2 8
-
The Shell will start running the container
docker run -v "/root/inputFile:/csvserver/inputdata" infracloudio/csvserver:latest
-
The Shell will start running the container in background
docker run -d -v "/root/inputFile:/csvserver/inputdata" infracloudio/csvserver:latest
-
Shell access to the container
docker exec -it 4c5d /bin/bash
-
This will check on which the application is listening
netstat -tuln
-
This will remove the running container
docker stop 4c5d docker rm 4c5d
-
Set the environment variable CSVSERVER_BORDER to have value Orange
docker run -d -p 9300:9300 -e CSVSERVER_BORDER=Orange -v "/root/inputFile:/csvserver/inputdata" infracloudio/csvserver:latest
-
Application running on this address
https://192.168.0.18:9300
-
to run the docker compose file
docker-compose up -d
-
Ensure no containers are running from the previous setup
docker-compose down
-
To run the docker compose file
docker-compose up -d
-
Application running on this address
https://192.168.0.18:9090
Individual Solution of each part are present in the solution folder