github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/docker/sawtooth-dev-validator (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 Python. The default CMD is to 18 # run build_python. 19 # 20 # The image is also used by unit and integration tests. Docker is used to 21 # interact with and orchestrate the creation of other docker containers. 22 # 23 # Build: 24 # $ cd sawtooth-core/docker 25 # $ docker build . -f sawtooth-dev-python -t sawtooth-dev-python 26 # 27 # Run: 28 # $ cd sawtooth-core 29 # $ docker run -v $(pwd):/project/sawtooth-core \ 30 # -v /var/run/docker.sock:/var/run/docker.sock sawtooth-dev-python 31 32 FROM ubuntu:xenial 33 34 LABEL "install-type"="mounted" 35 36 RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \ 37 && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \ 38 && apt-get update \ 39 && apt-get install -y -q \ 40 apt-transport-https \ 41 build-essential \ 42 ca-certificates \ 43 curl \ 44 gcc \ 45 git \ 46 inetutils-ping \ 47 libffi-dev \ 48 libssl-dev \ 49 libzmq3-dev \ 50 openssl \ 51 pkg-config \ 52 python3-aiodns=1.1.1-1 \ 53 python3-aiohttp>=2.3.2-1 \ 54 python3-aiopg \ 55 python3-async-timeout=1.2.0-1 \ 56 python3-bitcoin=1.1.42-1 \ 57 python3-cbor \ 58 python3-cchardet=2.0a3-1 \ 59 python3-colorlog \ 60 python3-cov-core \ 61 python3-cryptography-vectors=1.7.2-1 \ 62 python3-cryptography=1.7.2-1 \ 63 python3-dev \ 64 python3-grpcio-tools=1.1.3-1 \ 65 python3-grpcio=1.1.3-1 \ 66 python3-lmdb=0.92-1 \ 67 python3-multidict=2.1.4-1 \ 68 python3-netifaces=0.10.4-0.1build2 \ 69 python3-nose2 \ 70 python3-pip \ 71 python3-protobuf \ 72 python3-psycopg2 \ 73 python3-pycares=2.1.1-1 \ 74 python3-pyformance \ 75 python3-pytest-runner=2.6.2-1 \ 76 python3-pytest=2.9.0-1 \ 77 python3-pytz=2016.10-1 \ 78 python3-requests \ 79 python3-secp256k1=0.13.2-1 \ 80 python3-setuptools-scm=1.15.0-1 \ 81 python3-six=1.10.0-1 \ 82 python3-toml \ 83 python3-yaml \ 84 python3-yarl=0.10.0-1 \ 85 python3-zmq \ 86 software-properties-common \ 87 unzip \ 88 && apt-get clean \ 89 && rm -rf /var/lib/apt/lists/* \ 90 && pip3 install \ 91 pylint \ 92 pycodestyle \ 93 bandit \ 94 coverage --upgrade 95 96 RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ 97 && add-apt-repository \ 98 "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ 99 $(lsb_release -cs) \ 100 stable" 101 102 RUN apt-get update && apt-get install -y -q \ 103 docker-ce \ 104 && apt-get clean \ 105 && rm -rf /var/lib/apt/lists/* 106 107 RUN curl -OLsS https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip \ 108 && unzip protoc-3.5.1-linux-x86_64.zip -d protoc3 \ 109 && rm protoc-3.5.1-linux-x86_64.zip 110 111 RUN curl https://sh.rustup.rs -sSf > /usr/bin/rustup-init \ 112 && chmod +x /usr/bin/rustup-init \ 113 && rustup-init -y 114 115 ENV PATH=$PATH:/project/sawtooth-core/bin:/protoc3/bin:/project/sawtooth-core/bin:/root/.cargo/bin \ 116 CARGO_INCREMENTAL=0 117 118 RUN rustup component add rustfmt-preview 119 120 RUN ln -s /usr/bin/python3 /usr/bin/python 121 122 EXPOSE 4004/tcp 123 EXPOSE 8008 124 125 RUN mkdir -p /project/sawtooth-core/ \ 126 && mkdir -p /var/log/sawtooth \ 127 && mkdir -p /var/lib/sawtooth \ 128 && mkdir -p /etc/sawtooth \ 129 && mkdir -p /etc/sawtooth/keys 130 131 WORKDIR /project/sawtooth-core 132 CMD build_validator