-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD_AND_RUN.sh
executable file
·77 lines (56 loc) · 2.97 KB
/
BUILD_AND_RUN.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#Build the containers
docker build --tag 660046669/bluebook:latest BlueBook
docker build --tag 660046669/mta:latest MTA
docker build --tag 660046669/msa:latest MSA
#Build the network
docker network prune
docker network create --subnet 192.168.1.0/24 emailnet-660046669
#Run the Bluebook
docker container rm -f BlueBook
#Bluebook NEEDS to be assigned 192.168.1.3
docker run --name BlueBook --net emailnet-660046669 --ip 192.168.1.3 --detach \
--restart on-failure --publish 3008:8888 660046669/bluebook:latest
#Run two MTA servers with different domains
docker container rm -f MTA-here.com
docker container rm -f MTA-there.com
docker container rm -f MTA-other.org
#No need to provide an IP address! This is handled by the agent
docker run --name MTA-here.com --net emailnet-660046669 --detach \
--restart on-failure --publish 3005:8888 660046669/mta:latest here.com
docker run --name MTA-there.com --net emailnet-660046669 --detach \
--restart on-failure --publish 3006:8888 660046669/mta:latest there.com
docker run --name MTA-other.org --net emailnet-660046669 --detach \
--restart on-failure --publish 3007:8888 660046669/mta:latest other.org
#Run 5 MSA clients with different addresses
docker container rm -f [email protected]
docker container rm -f [email protected]
docker container rm -f [email protected]
docker container rm -f [email protected]
docker container rm -f [email protected]
#No need to provide an IP address! This is handled by the agent
docker run --name MSA-billgates.at.here.com --net emailnet-660046669 --detach \
--restart on-failure \
--publish 3000:8888 660046669/msa:latest [email protected]
docker run --name MSA-alanturing.at.here.com --net emailnet-660046669 --detach \
--restart on-failure \
--publish 3001:8888 660046669/msa:latest [email protected]
docker run --name MSA-stevejobs.at.there.com --net emailnet-660046669 --detach \
--restart on-failure \
--publish 3002:8888 660046669/msa:latest [email protected]
docker run --name MSA-adalovelace.at.there.com --net emailnet-660046669 \
--restart on-failure --detach \
--publish 3003:8888 660046669/msa:latest [email protected]
docker run --name MSA-gracehopper.at.other.org --net emailnet-660046669 \
--restart on-failure --detach \
--publish 3004:8888 660046669/msa:latest [email protected]
# Here are some examples...
# Sending an email:
# curl -v --request POST 'http://localhost:3002/email' -d '{ "from": "[email protected]", "to": "[email protected]", "subject": "Successes and failures", "body": "Hey, remember Windows Phone? Me neither." }'
# Reading the inbox:
# curl -v --request GET 'http://localhost:3000/email'
# Read one message in the inbox:
# curl -v --request GET 'http://localhost:3000/email{uuid}
# Find the UUID by first listing all messages in the inbox, and replace it in the URL
# Delete a message in the inbox:
# curl -v --request DELETE 'http://localhost:3000/email {uuid}
# Find the UUID by first listing all messages in the inbox, and replace it in the URL