-
Clone this repository - https://github.com/diksha/HW4
git clone https://github.com/diksha/HW4.git
-
Run
docker-compose up
This will create containers for proxy main and redis and will also start the server.
-
Run infrastructure.js
node infrastructure.js
-
Spawn a new server
localhost:8001/spawn
This will spawn a new server
##Part 2
- Copy HW4Part2 post-commit into git hooks of App
- Copy HW4Part2 green_post-receive to post-receive in green.git hooks
- Copy HW4Part2 blue_post-receive to post-receive in blue.git hooks
Commit some change to App
And then push to blue or green
git push green master
We can see that the code is pushed to green and a docker is spawned.
##Part 3
- Clone HW4Part3
Do the following steps
Create a container that runs a command that outputs to a file.
docker build -t container1 .
Use socat to map file access to read file container and expose over port 9001 (hint can use SYSTEM + cat).
docker run -td --name first_container container1
Creates 1st container
docker build -t container2 .
docker run -td --link first_container1:input --name second_container1 container2
Creates 2nd container and links it
docker exec -it second_container1 bash
Use a linked container that access that file over network. The linked container can just use a command such as curl to access data from other container.
curl input:9001