github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/docker/sawtooth-dev-rust (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 Rust. The default CMD is to run
    18  #   build_rust.
    19  #
    20  # Build:
    21  #   $ cd sawtooth-core/docker
    22  #   $ docker build . -f sawtooth-dev-rust -t sawtooth-dev-rust
    23  #
    24  # Run:
    25  #   $ cd sawtooth-core
    26  #   $ docker run -v $(pwd):/project/sawtooth-core sawtooth-dev-rust
    27  
    28  FROM ubuntu:xenial
    29  
    30  LABEL "install-type"="mounted"
    31  
    32  RUN echo "deb [arch=amd64] http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \
    33   && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \
    34   || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \
    35   && apt-get update \
    36   && apt-get install -y -q --allow-downgrades \
    37      build-essential \
    38      curl \
    39      libssl-dev \
    40      gcc \
    41      libzmq3-dev \
    42      openssl \
    43      pkg-config \
    44      python3-grpcio-tools=1.1.3-1 \
    45      unzip \
    46   && apt-get clean \
    47   && rm -rf /var/lib/apt/lists/*
    48  
    49  RUN curl -OLsS https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip \
    50   && unzip protoc-3.5.1-linux-x86_64.zip -d protoc3 \
    51   && rm protoc-3.5.1-linux-x86_64.zip
    52  
    53  RUN curl https://sh.rustup.rs -sSf > /usr/bin/rustup-init \
    54   && chmod +x /usr/bin/rustup-init \
    55   && rustup-init -y
    56  
    57  ENV PATH=$PATH:/protoc3/bin:/project/sawtooth-core/bin:/root/.cargo/bin \
    58      CARGO_INCREMENTAL=0
    59  
    60  RUN rustup component add rustfmt-preview
    61  
    62  WORKDIR /
    63  
    64  CMD build_rust