Skip to content

Instantly share code, notes, and snippets.

@marcus-gomes-v
Last active December 24, 2021 18:39
Show Gist options
  • Save marcus-gomes-v/d3408c1bb5684c42de9d310a924f0ae8 to your computer and use it in GitHub Desktop.
Save marcus-gomes-v/d3408c1bb5684c42de9d310a924f0ae8 to your computer and use it in GitHub Desktop.
#!/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
@marcus-gomes-v
Copy link
Author

Just remove old name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment