Browse Source

Setting some basic parameters of the chainspace dockerfile

Jim Barritt 11 months ago
parent
commit
4c55762292

+ 38 - 29
apps/petitions/decode-app/ops/artifact/chainspace/Dockerfile

@@ -1,44 +1,47 @@
1
-  FROM alpine:3.6
1
+  FROM ubuntu:16.04
2 2
 
3
-    ARG zenroom_tag=bfa60a9e48b781c09fd9b4fe4bfef865bc127075
3
+    apt update
4
+    #apt upgrade -y # this takes some time!
5
+
6
+    RUN apt-get install -y zsh git make tree
7
+
8
+    # Zenroom installation
9
+    RUN apt-get install -y cmake gcc musl-dev musl
4 10
 
5
-    WORKDIR /code/zenroom
11
+    ARG zenroom_tag=bfa60a9e48b781c09fd9b4fe4bfef865bc127075
6 12
 
7
-    RUN apk update
8
-    RUN apk upgrade
9
-    RUN apk add --no-cache git openssh git
13
+    WORKDIR /usr/local/src/zenroom
10 14
 
11
-    RUN git clone \
12
-    https://github.com/DECODEproject/zenroom.git \
13
-    . \
14
-    && git checkout ${zenroom_tag} \
15
-    && git submodule init \
16
-    && git submodule update
15
+    RUN git clone https://github.com/DECODEproject/zenroom.git . && \
16
+    git checkout ${zenroom_tag} && \
17
+    git submodule init && \
18
+    git submodule update
17 19
 
18
-    RUN apk add --no-cache make cmake gcc musl-dev musl musl-utils
19 20
     RUN make musl-system
20 21
 
21
-    FROM ubuntu:16.04
22
+    COPY --from=0 /usr/local/src/zenroom-static /usr/bin/zenroom
23
+    COPY --from=0 /usr/local/zenroom/examples/elgamal  /opt/contracts/
24
+
25
+    # Chainspace installation
26
+    RUN apt-get install -y openjdk-8-jdk maven virtualenv python python-setuptools wget gzip
27
+    RUN apt-get install -y libssl-dev libffi-dev python-dev
28
+
22 29
 
23
-    RUN apt-get update && \
24
-    apt-get install -y openjdk-8-jdk && \
25
-    apt-get install -y ant screen virtualenv python python-setuptools wget gzip \
26
-    build-essential libssl-dev libffi-dev python-dev maven && \
27
-    apt-get clean && \
28
-    rm -rf /var/lib/apt/lists/*;
29 30
 
31
+    WORKDIR /usr/local/src/chainspace
32
+    RUN git clone https://github.com/DECODEproject/chainspace.git .
30 33
 
31
-    COPY chainspaceapi /app/chainspaceapi
32
-    COPY chainspacecontract /app/chainspacecontract
33
-    COPY chainspacecore /app/chainspacecore
34
-    COPY contrib /app/contrib
35
-    COPY Makefile /app/
34
+    make build-jar
35
+    make dist
36 36
 
37
-    COPY --from=0 /code/zenroom/src/zenroom-static /usr/bin/zenroom
38
-    COPY --from=0 /code/zenroom/examples/elgamal  /opt/contracts/
37
+    # Copy the dist folders to /opt/chainspace
39 38
 
39
+
40
+    # move into that dir
41
+
42
+    # Setup python virtualenv
40 43
     RUN easy_install pip
41
-    WORKDIR /app
44
+
42 45
     RUN virtualenv .chainspace.env
43 46
     RUN . .chainspace.env/bin/activate && pip install -U setuptools
44 47
     RUN . .chainspace.env/bin/activate && pip install -e ./chainspaceapi
@@ -46,4 +49,10 @@
46 49
     RUN . .chainspace.env/bin/activate && pip install petlib
47 50
     RUN . .chainspace.env/bin/activate && make build-jar
48 51
 
49
-    CMD make start-nodes && make start-client-api
52
+
53
+
54
+# Run a root script called up.sh from the root of the dist folder
55
+# Make sure the log files all go into /var/log
56
+#
57
+#    CMD make start-nodes && make start-client-api # update these so that they start from the dist fol
58
+    CMD bash

+ 3 - 0
apps/petitions/decode-app/ops/local/docker.sh

@@ -21,6 +21,9 @@ function status {
21 21
 }
22 22
 
23 23
 function init {
24
+    cd ${SCRIPT_HOME}/../artifact/chainspace
25
+    docker build -t chainspace-dev:v1.0
26
+    cd -
24 27
     ${DOCKER_COMMAND} up --no-start
25 28
 
26 29
 }