We're going to get our lab environment set up. To do that we need to...
- Navigate to https://github.com/pdreeves/2019-interactive, click "Clone or download" on the right, then click "Download ZIP".
Note: you do not need to have a GitHub account created to download the file.
-
Unzip the newly downloaded file, place that folder in the root (C:\) of your hard drive, make note of the path for that folder.
-
Start Docker Desktop with administrative privileges if it's not already running.
-
Launch a command prompt with administrative privileges
-
Start the Splunk docker container bu running this command:
docker container run --detach --hostname splunk --name splunk --interactive --tty --publish 8000:8000 --env SPLUNK_PASSWORD="interactive" pdreeves/2019-interactive-splunk
- Start our first webserver, named web1, which will listen on localhost:81:
docker container run --detach --link=splunk --privileged --hostname web1 --name web1 --interactive --tty --publish 81:80 --volume /sys/fs/cgroup:/sys/fs/cgroup:ro pdreeves/2019-interactive-web
- Start our second webserver, named web2, which will listen on localhost:82:
docker container run --detach --link=splunk --privileged --hostname web2 --name web2 --interactive --tty --publish 82:80 --volume /sys/fs/cgroup:/sys/fs/cgroup:ro pdreeves/2019-interactive-web
- Start our Ansible server, named ansible, and replace {{unzippedFolder}} with the location of the unzipped folder:
docker container run --detach --link=web1 --link=web2 --hostname ansible --name ansible --interactive --tty --volume {{unzippedFolder}}:/opt/external pdreeves/2019-interactive-ansible
For example, if I unzipped the folder in C:\2019-interactive-master: the command would be... docker container run --detach --link=web1 --link=web2 --hostname ansible --name ansible --interactive --tty --volume C:\2019-interactive-master:/opt/external pdreeves/2019-interactive-ansible
- Navigate to the Instructions folder and start with scenario 1
We're going to get our lab environment set up. To do that we need to...
- Navigate to https://github.com/pdreeves/2019-interactive, click "Clone or download" on the right, then click "Download ZIP".
Note: you do not need to have a GitHub account to download the file.
-
Unzip the newly downloaded file, and make note of the path for that folder.
-
Start Docker if it's not already running
-
Start the Splunk docker container by running this command:
docker container run --detach --hostname splunk --name splunk --interactive --tty --publish 8000:8000 --env SPLUNK_PASSWORD="interactive" pdreeves/2019-interactive-splunk
- Start our first webserver, named web1, which will listen on localhost:81:
docker container run --detach --link=splunk --privileged --hostname web1 --name web1 --interactive --tty --publish 81:80 --volume /sys/fs/cgroup:/sys/fs/cgroup:ro pdreeves/2019-interactive-web
- Start our second webserver, named web2, which will listen on localhost:82:
docker container run --detach --link=splunk --privileged --hostname web2 --name web2 --interactive --tty --publish 82:80 --volume /sys/fs/cgroup:/sys/fs/cgroup:ro pdreeves/2019-interactive-web
- Start our Ansible server, named ansible, and replace {{unzippedFolder}} with the location of the unzipped folder:
docker container run --detach --link=web1 --link=web2 --hostname ansible --name ansible --interactive --tty --volume {{unzippedFolder}}:/opt/external pdreeves/2019-interactive-ansible
For example, if I unzipped the folder in /Users/pdreeves/Downloads/2019-interactive-master the command would be... docker container run --detach --link=web1 --link=web2 --hostname ansible --name ansible --interactive --tty --volume /Users/pdreeves/Downloads/2019-interactive-master:/opt/external pdreeves/2019-interactive-ansible
- Navigate to the Instructions folder and start with scenario 1
It's ok if you make a mistake and need to re-set the lab, that's the great thing about containers!
- Run these commands to stop and delete the containers:
docker container stop ansible web2 web1 splunk
docker container rm ansible web2 web1 splunk
- Then these commands to spin up fresh containers:
docker container run --detach --hostname splunk --name splunk --interactive --tty --publish 8000:8000 --env SPLUNK_PASSWORD="interactive" 2019-interactive-splunk
docker container run --detach --link=splunk --privileged --hostname web1 --name web1 --interactive --tty --publish 81:80 --volume /sys/fs/cgroup:/sys/fs/cgroup:ro 2019-interactive-web
docker container run --detach --link=splunk --privileged --hostname web2 --name web2 --interactive --tty --publish 82:80 --volume /sys/fs/cgroup:/sys/fs/cgroup:ro 2019-interactive-web
docker container run --detach --link=web1 --link=web2 --hostname ansible --name ansible --interactive --tty --volume {{unzippedFolder}}:/opt/external 2019-interactive-ansible