Created
October 19, 2017 16:51
-
-
Save maedoc/01fd7b97852ed2a6a24d5722055e88aa to your computer and use it in GitHub Desktop.
a few functions to make it easier to test out Guacamole with Docker
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 | |
function setup_db() { | |
docker run -d --name gcpg postgres | |
echo "waiting for db to spin up..." | |
sleep 2 | |
docker exec gcpg psql -U postgres -c 'CREATE DATABASE gcdb;' | |
docker exec gcpg psql -U postgres -c "CREATE ROLE gcu WITH PASSWORD 'foo';" | |
docker exec gcpg psql -U postgres -c "ALTER ROLE gcu WITH LOGIN;" | |
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres | \ | |
docker exec -i gcpg psql -U gcu -d gcdb | |
} | |
function start_gcd() { | |
docker run -d --name some-guacd guacamole/guacd | |
} | |
function start_gcs() { | |
docker run --rm --name some-guacamole --link some-guacd:guacd --link gcpg:postgres -it -p 8080:8080 -e POSTGRES_DATABASE=gcdb -e POSTGRES_USER=gcu -e POSTGRES_PASSWORD=foo guacamole/guacamole | |
} | |
function stop_gc() { | |
docker rm -f some-guacamole | |
docker rm -f some-guacd | |
docker rm -f gcpg | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment