Last active
December 24, 2021 18:39
-
-
Save marcus-gomes-v/d3408c1bb5684c42de9d310a924f0ae8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ask the user for the folder to create host | |
# TODO: Not display the error when docker container is not running | |
echo " Try to stop static-arvis-dock if is running: " | |
docker stop static-arvis-dock | |
docker rm static-arvis-dock | |
echo | |
echo | |
echo " _____ ______ ______ __ __ ______ "; | |
echo "/\ __-. /\ __ \ /\ ___\ /\ \/ / /\ ___\ "; | |
echo "\ \ \/\ \ \ \ \/\ \ \ \ \____ \ \ _'-. \ \___ \ "; | |
echo " \ \____- \ \_____\ \ \_____\ \ \_\ \_\ \/\_____\ "; | |
echo " \/____/ \/_____/ \/_____/ \/_/\/_/ \/_____/ "; | |
echo " v0.0.1 "; | |
echo | |
echo "Welcome to Docks" | |
echo | |
echo "Lets create a simple virtualhost of nginx server, at https://localhost and the port you choose" | |
echo "But first we need you tell us the foldername to send the trafic" | |
echo | |
echo "Current path: " | |
printf '\e[1;32m%-6s\e[m' "$(pwd)" | |
echo | |
echo | |
echo "Current directories: " | |
for i in $(ls) | |
do | |
printf '\e[1;35m%-6s\e[m' " - ${i}" | |
echo | |
done | |
echo | |
echo "path-to-folder : " | |
read varname | |
echo | |
printf 'π³π³π³ \e[0;36m%-6s\e[m π³π³π³' "Let's Dockerize" | |
echo | |
echo | |
printf ' Virtual Path to: \e[0;31m%-6s\e[m' "$(pwd)/${varname}" | |
echo | |
echo | |
printf ' Container: \e[0;36m%-6s\e[m' "$(docker run --name static-arvis-dock -p 8080:80 -v $(pwd)/$varname:/usr/share/nginx/html -d nginx)" | |
echo | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just remove old name