summaryrefslogtreecommitdiff
path: root/docker/README
blob: 8701ab6169738a61ca140c50ec4fdf1b946001d5 (plain)
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
78
79
80
81
82
83
84
=== Dockerizing the Exchange ===

This section shows how to run a "dockerized" exchange.
The exchange uses postgresql (container) and is served
by nginx (container).

The docker's tools needed are: docker, docker-compose, docker-machine.
Please refer to Docker's official documentation for their installation
instructions.

Before starting to build the exchange's image, make sure a docker-machine
instance is up and running.

1. Build the images.

From <THIS_REPO/docker>, give:

$ docker-compose build

This command builds the 'base' image and pulls down the postgresql
and nginx images.

2. Launch the service.

The following command launches the exchange and all other services
it depends on.  From the same directory as the previous step, issue:

$ docker-compose up

If everything worked as expected, you should see some live logging
from all the containers.

PS. Errors about existing roles/databases can be ignored.

3. Test

Issue the following command to see if the exchange has been correctly
installed and launched.

$ curl http://`docker-machine ip`:80/

and

$ curl http://`docker-machine ip`:80/keys

=== How to use these images ===

This section explains how to (1) build and (2) run individual
images -- that is often not useful to run services, as they need
to be "composed" in order to work properly.

(1) is done by:

$ docker build -t taler/base <THIS_REPO>/docker/base/
$ docker build -t taler/exchange <THIS_REPO>/docker/exchange/

Note that the value passed to option -t is completely arbitrary.

(2) is done by:

$ docker run -it taler/exchange

=== How to destroy them ===

Consider also the --no-cache option to force a rebuild.

 $ docker build --no-cache <THIS_REPO>/docker/base

1. Stop all containers:

  $ docker stop $(docker ps -a -q)


2. If necessary, remove all containers:

  $ docker rm $(docker ps -a -q)

3. Remove images:

  $ docker rmi -f $(docker images -q)


NOTE: for tripwire users, those commands are all defined
      as aliases.