-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Joas Schilling <coding@schilljs.com>
- Loading branch information
1 parent
1162f4d
commit 81a43d3
Showing
5 changed files
with
63 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
DC_IP=$1 | ||
shift | ||
|
||
docker run --rm --name client -v /tmp/shared:/shared --dns $DC_IP --hostname client.domain.test icewind1991/samba-krb-test-client $@ |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker rm -f apache 2>/dev/null > /dev/null | ||
|
||
docker run -d --name apache -v $2:/var/www/html -v /tmp/shared:/shared --dns $1 --hostname httpd.domain.test icewind1991/samba-krb-test-apache 1>&2 | ||
APACHE_IP=$(docker inspect apache --format '{{.NetworkSettings.IPAddress}}') | ||
|
||
# add the dns record for apache | ||
docker exec dc samba-tool dns add krb.domain.test domain.test httpd A $APACHE_IP -U administrator --password=passwOrd1 1>&2 | ||
|
||
echo $APACHE_IP |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
function getContainerHealth { | ||
docker inspect --format "{{.State.Health.Status}}" $1 | ||
} | ||
|
||
function waitContainer { | ||
while STATUS=$(getContainerHealth $1); [ $STATUS != "healthy" ]; do | ||
if [ $STATUS == "unhealthy" ]; then | ||
echo "Failed!" 1>&2 | ||
exit -1 | ||
fi | ||
printf . 1>&2 | ||
lf=$'\n' | ||
sleep 1 | ||
done | ||
printf "$lf" 1>&2 | ||
} | ||
|
||
docker rm -f dc 2>/dev/null > /dev/null | ||
|
||
mkdir -p /tmp/shared | ||
|
||
# start the dc | ||
docker run -dit --name dc -v /tmp/shared:/shared --hostname krb.domain.test --cap-add SYS_ADMIN icewind1991/samba-krb-test-dc 1>&2 | ||
|
||
waitContainer dc | ||
|
||
docker inspect dc --format '{{.NetworkSettings.IPAddress}}' |