You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
754 B
19 lines
754 B
#!/bin/bash
|
|
# get the container name from the current working directory
|
|
CNT_NAME=$(basename $(pwd))
|
|
|
|
echo "starting the nginx-webserver in a container named $IMGAE_NAME"
|
|
docker run -it --rm -d -p 8080:80 --name $CNT_NAME nginx
|
|
|
|
# tell user what to do :)
|
|
echo "okay. now fire up browser and type 'http://$(hostname).simple.eee.intern:8080/' into address bar."
|
|
echo "you should see the nginx welcome page."
|
|
echo
|
|
read -n 1 -p "press any key to copy our web-page to to container."
|
|
docker cp index.html $CNT_NAME:/usr/share/nginx/html/
|
|
echo "okay, done"
|
|
echo "now reload the page in your browser. you should see our web-page."
|
|
echo
|
|
read -n 1 -p "when done, press any key to stop (and remove) the webserver container."
|
|
docker stop $CNT_NAME
|
|
echo "sweet. bye!"
|
|
|