github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/validator/Dockerfile (about)

     1  # Copyright 2018 Cargill Incorporated
     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  # docker build -f validator/Dockerfile -t sawtooth-validator-local .
    16  
    17  # -------------===  build ===-------------
    18  
    19  FROM ubuntu:xenial
    20  
    21  RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \
    22   && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \
    23   || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \
    24   && apt-get update
    25  
    26  RUN apt-get install -y -q --allow-downgrades \
    27      git \
    28      python3 \
    29      python3-stdeb
    30  
    31  RUN apt-get install -y -q --allow-downgrades \
    32      python3-grpcio \
    33      python3-grpcio-tools \
    34      python3-protobuf
    35  
    36  RUN apt-get install -y -q --allow-downgrades \
    37      python3-cbor \
    38      python3-colorlog \
    39      python3-cryptography>=1.7.1 \
    40      python3-dev \
    41      python3-lmdb \
    42      python3-netifaces=0.10.4-0.1build2 \
    43      python3-pyformance \
    44      python3-secp256k1 \
    45      python3-toml \
    46      python3-yaml \
    47      python3-zmq \
    48      unzip
    49  
    50  RUN curl -OLsS https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip \
    51   && unzip protoc-3.5.1-linux-x86_64.zip -d protoc3 \
    52   && rm protoc-3.5.1-linux-x86_64.zip
    53  
    54  RUN curl https://sh.rustup.rs -sSf > /usr/bin/rustup-init \
    55   && chmod +x /usr/bin/rustup-init \
    56   && rustup-init -y
    57  
    58  ENV PATH=$PATH:/project/sawtooth-core/bin:/protoc3/bin:/project/sawtooth-core/bin:/root/.cargo/bin \
    59      CARGO_INCREMENTAL=0
    60  
    61  RUN ln -s /usr/bin/python3 /usr/bin/python
    62  
    63  RUN mkdir -p /etc/sawtooth/keys
    64  RUN mkdir -p /var/lib/sawtooth
    65  RUN mkdir -p /var/log/sawtooth
    66  
    67  ENV PATH=$PATH:/project/sawtooth-core/bin
    68  
    69  WORKDIR /project/sawtooth-core
    70  
    71  CMD echo "\033[0;32m--- Building validator ---\n\033[0m" \
    72   && ./bin/protogen \
    73   && cd validator \
    74   && if [ -d "debian" ]; then rm -rf debian; fi \
    75   && python3 setup.py clean --all \
    76   && python3 setup.py --command-packages=stdeb.command debianize \
    77   && if [ -d "packaging/ubuntu" ]; then cp -R packaging/ubuntu/* debian/; fi \
    78   && if [ -d "bin" ]; then rm -rf bin; fi \
    79   && mkdir bin \
    80   && if [ -d "lib" ]; then rm -rf lib; fi \
    81   && mkdir lib \
    82   && cargo build --release \
    83   && cp ./target/release/sawtooth-validator bin/sawtooth-validator \
    84   && cp ./target/release/libsawtooth_validator.so lib/libsawtooth_validator.so