Hi I have this bash script with loop through every directories and build it
for d in * ;
do (cd ./"$d" && docker build -t "$d" .);
done
the problem is docker does not support uppercase for images name, so with the directory named repairService
I want to rename the images to service-desk
.
How do I achive that with bash scripting
Also I don't want to build it with docker compose so don't answer it with docker compose
CodePudding user response:
An IF condition is added & then the variable value is reassigned.
#!/bin/sh
for d in *;
do
if [ "$d" = "repairService" ];
then d="service-desk";
fi;
echo "$d"; # Your docker operation here
done