github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/docker/sawtooth-dev-javascript (about)

     1  # Copyright 2017 Intel Corporation
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  # ------------------------------------------------------------------------------
    15  
    16  # Description:
    17  #   Builds an image to be used when developing in JavaScript. The default CMD is to run
    18  #   build_javascript.
    19  #
    20  # Build:
    21  #   $ cd sawtooth-core/docker
    22  #   $ docker build . -f sawtooth-dev-javascript -t sawtooth-dev-javascript
    23  #
    24  # Run:
    25  #   $ cd sawtooth-core
    26  #   $ docker run -v $(pwd):/project/sawtooth-core sawtooth-dev-javascript
    27  
    28  FROM ubuntu:xenial
    29  
    30  LABEL "install-type"="mounted"
    31  
    32  RUN apt-get update && apt-get install -y -q --no-install-recommends \
    33      curl \
    34      ca-certificates \
    35      pkg-config \
    36      build-essential \
    37      libfontconfig \
    38      libzmq3-dev \
    39   && curl -s -S -o /tmp/setup-node.sh https://deb.nodesource.com/setup_6.x \
    40   && chmod 755 /tmp/setup-node.sh \
    41   && /tmp/setup-node.sh \
    42   && apt-get install nodejs -y -q \
    43   && rm /tmp/setup-node.sh \
    44   && apt-get clean \
    45   && rm -rf /var/lib/apt/lists/*
    46  
    47  RUN \
    48   if [ ! -z $HTTP_PROXY ] && [ -z $http_proxy ]; then \
    49    http_proxy=$HTTP_PROXY; \
    50   fi; \
    51   if [ ! -z $HTTPS_PROXY ] && [ -z $https_proxy ]; then \
    52    https_proxy=$HTTPS_PROXY; \
    53   fi; \
    54   if [ ! -z $http_proxy ]; then \
    55    npm config set proxy $http_proxy; \
    56   fi; \
    57   if [ ! -z $https_proxy ]; then \
    58    npm config set https-proxy $https_proxy; \
    59   fi
    60  
    61  RUN npm install -g \
    62      prebuild-install \
    63      phantomjs-prebuilt
    64  
    65  EXPOSE 4004/tcp
    66  
    67  RUN mkdir -p /project/sawtooth-core/ \
    68   && mkdir -p /var/log/sawtooth \
    69   && mkdir -p /var/lib/sawtooth \
    70   && mkdir -p /etc/sawtooth \
    71   && mkdir -p /etc/sawtooth/keys
    72  
    73  ENV PATH=$PATH:/project/sawtooth-core/bin:/node_modules/phantomjs-prebuilt/bin
    74  
    75  WORKDIR /
    76  
    77  CMD /project/sawtooth-core/bin/build_javascript_sdk \
    78   && /project/sawtooth-core/bin/build_intkey_javascript \
    79   && /project/sawtooth-core/bin/build_xo_javascript