github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/consensus/poet/cli/Dockerfile-installed (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 consensus/poet/cli/Dockerfile-installed -t sawtooth-poet-cli . 16 17 # -------------=== signing build ===------------- 18 FROM ubuntu:xenial as sawtooth-signing-builder 19 20 ENV VERSION=AUTO_STRICT 21 22 RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \ 23 && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \ 24 || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \ 25 && apt-get update \ 26 && apt-get install -y -q --allow-downgrades \ 27 git \ 28 python3 \ 29 python3-protobuf \ 30 python3-secp256k1 \ 31 python3-stdeb \ 32 python3-grpcio-tools \ 33 python3-grpcio 34 35 COPY . /project 36 37 RUN /project/bin/protogen \ 38 && cd /project/signing \ 39 && if [ -d "debian" ]; then rm -rf debian; fi \ 40 && python3 setup.py clean --all \ 41 && python3 setup.py --command-packages=stdeb.command debianize \ 42 && if [ -d "packaging/ubuntu" ]; then cp -R packaging/ubuntu/* debian/; fi \ 43 && dpkg-buildpackage -b -rfakeroot -us -uc 44 45 46 # -------------=== validator build ===------------- 47 FROM ubuntu:xenial as sawtooth-validator-builder 48 49 ENV VERSION=AUTO_STRICT 50 51 RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \ 52 && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \ 53 || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \ 54 && apt-get update \ 55 && apt-get install -y -q --allow-downgrades \ 56 git \ 57 python3 \ 58 python3-dev \ 59 python3-grpcio \ 60 python3-grpcio-tools \ 61 python3-protobuf \ 62 python3-pyformance \ 63 python3-secp256k1 \ 64 python3-stdeb \ 65 python3-toml \ 66 unzip 67 68 RUN curl -OLsS https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip \ 69 && unzip protoc-3.5.1-linux-x86_64.zip -d protoc3 \ 70 && rm protoc-3.5.1-linux-x86_64.zip 71 72 RUN curl https://sh.rustup.rs -sSf > /usr/bin/rustup-init \ 73 && chmod +x /usr/bin/rustup-init \ 74 && rustup-init -y 75 76 ENV PATH=$PATH:/project/sawtooth-core/bin:/protoc3/bin:/project/sawtooth-core/bin:/root/.cargo/bin \ 77 CARGO_INCREMENTAL=0 78 79 RUN ln -s /usr/bin/python3 /usr/bin/python 80 81 COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp 82 83 COPY . /project 84 85 RUN dpkg -i /tmp/python3-sawtooth-signing*.deb || true \ 86 && apt-get -f -y install \ 87 && /project/bin/protogen \ 88 && cd /project/validator \ 89 && if [ -d "debian" ]; then rm -rf debian; fi \ 90 && python3 setup.py clean --all \ 91 && python3 setup.py --command-packages=stdeb.command debianize \ 92 && if [ -d "packaging/ubuntu" ]; then cp -R packaging/ubuntu/* debian/; fi \ 93 && if [ -d "bin" ]; then rm -rf bin; fi \ 94 && mkdir bin \ 95 && if [ -d "lib" ]; then rm -rf lib; fi \ 96 && mkdir lib \ 97 && cargo build --release \ 98 && cp ./target/release/sawtooth-validator bin/sawtooth-validator \ 99 && cp ./target/release/libsawtooth_validator.so lib/libsawtooth_validator.so \ 100 && dpkg-buildpackage -b -rfakeroot -us -uc 101 102 103 # -------------=== poet common build ===------------- 104 105 FROM ubuntu:xenial as poet-common-builder 106 107 ENV VERSION=AUTO_STRICT 108 109 RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \ 110 && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \ 111 || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \ 112 && apt-get update \ 113 && apt-get install -y -q --allow-downgrades \ 114 git \ 115 python3 \ 116 python3-grpcio-tools \ 117 python3-grpcio \ 118 python3-protobuf \ 119 python3-stdeb 120 121 COPY . /project 122 123 RUN /project/bin/protogen \ 124 && cd /project/consensus/poet/common/ \ 125 && if [ -d "debian" ]; then rm -rf debian; fi \ 126 && python3 setup.py clean --all \ 127 && python3 setup.py --command-packages=stdeb.command debianize \ 128 && if [ -d "packaging/ubuntu" ]; then cp -R packaging/ubuntu/* debian/; fi \ 129 && dpkg-buildpackage -b -rfakeroot -us -uc 130 131 132 # -------------=== simulator build ===------------- 133 FROM ubuntu:xenial as sawtooth-simulator-builder 134 135 ENV VERSION=AUTO_STRICT 136 137 RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \ 138 && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \ 139 || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \ 140 && apt-get update \ 141 && apt-get install -y -q --allow-downgrades \ 142 python3-cryptography>-1.7.1 \ 143 git \ 144 python3 \ 145 python3-protobuf \ 146 python3-secp256k1 \ 147 python3-stdeb \ 148 python3-grpcio-tools \ 149 python3-grpcio 150 151 COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp 152 COPY --from=poet-common-builder /project/consensus/poet/python3-sawtooth-poet-common*.deb /tmp 153 COPY --from=sawtooth-validator-builder /project/python3-sawtooth-validator*.deb /tmp 154 155 COPY . /project 156 157 RUN dpkg -i /tmp/python3-sawtooth*.deb || true \ 158 && apt-get -f -y install \ 159 && /project/bin/protogen \ 160 && cd /project/consensus/poet/simulator/ \ 161 && if [ -d "debian" ]; then rm -rf debian; fi \ 162 && python3 setup.py clean --all \ 163 && python3 setup.py --command-packages=stdeb.command debianize \ 164 && if [ -d "packaging/ubuntu" ]; then cp -R packaging/ubuntu/* debian/; fi \ 165 && dpkg-buildpackage -b -rfakeroot -us -uc 166 167 168 # -------------=== poet core build ===------------- 169 170 FROM ubuntu:xenial as poet-core-builder 171 172 ENV VERSION=AUTO_STRICT 173 174 RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \ 175 && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \ 176 || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \ 177 && apt-get update \ 178 && apt-get install -y -q --allow-downgrades \ 179 git \ 180 python3 \ 181 python3-grpcio-tools \ 182 python3-grpcio \ 183 python3-protobuf \ 184 python3-requests \ 185 python3-stdeb 186 187 COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp 188 COPY --from=poet-common-builder /project/consensus/poet/python3-sawtooth-poet-common*.deb /tmp 189 COPY --from=sawtooth-validator-builder /project/python3-sawtooth-validator*.deb /tmp 190 COPY --from=sawtooth-simulator-builder /project/consensus/poet/python3-sawtooth-poet-simulator*.deb /tmp 191 192 COPY . /project 193 194 RUN dpkg -i /tmp/python3-sawtooth*.deb || true \ 195 && apt-get -f -y install \ 196 && /project/bin/protogen \ 197 && cd /project/consensus/poet/core/ \ 198 && if [ -d "debian" ]; then rm -rf debian; fi \ 199 && python3 setup.py clean --all \ 200 && python3 setup.py --command-packages=stdeb.command debianize \ 201 && if [ -d "packaging/ubuntu" ]; then cp -R packaging/ubuntu/* debian/; fi \ 202 && dpkg-buildpackage -b -rfakeroot -us -uc 203 204 205 # -------------=== poet cli build ===------------- 206 207 FROM ubuntu:xenial as poet-cli-builder 208 209 ENV VERSION=AUTO_STRICT 210 211 RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \ 212 && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \ 213 || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \ 214 && apt-get update \ 215 && apt-get install -y -q --allow-downgrades \ 216 git \ 217 python3 \ 218 python3-colorlog \ 219 python3-grpcio-tools \ 220 python3-grpcio \ 221 python3-protobuf \ 222 python3-stdeb \ 223 python3-toml 224 225 COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp 226 COPY --from=poet-common-builder /project/consensus/poet/python3-sawtooth-poet-common*.deb /tmp 227 COPY --from=sawtooth-validator-builder /project/python3-sawtooth-validator*.deb /tmp 228 COPY --from=sawtooth-simulator-builder /project/consensus/poet/python3-sawtooth-poet-simulator*.deb /tmp 229 COPY --from=poet-core-builder /project/consensus/poet/python3-sawtooth-poet-core*.deb /tmp 230 231 COPY . /project 232 233 RUN dpkg -i /tmp/python3-sawtooth*.deb || true \ 234 && apt-get -f -y install \ 235 && /project/bin/protogen \ 236 && cd /project/consensus/poet/cli/ \ 237 && if [ -d "debian" ]; then rm -rf debian; fi \ 238 && python3 setup.py clean --all \ 239 && python3 setup.py --command-packages=stdeb.command debianize \ 240 && if [ -d "packaging/ubuntu" ]; then cp -R packaging/ubuntu/* debian/; fi \ 241 && dpkg-buildpackage -b -rfakeroot -us -uc 242 243 244 # -------------=== poet cli docker build ===------------- 245 FROM ubuntu:xenial 246 247 COPY --from=sawtooth-signing-builder /project/python3-sawtooth-signing*.deb /tmp 248 COPY --from=poet-common-builder /project/consensus/poet/python3-sawtooth-poet-common*.deb /tmp 249 COPY --from=sawtooth-validator-builder /project/python3-sawtooth-validator*.deb /tmp 250 COPY --from=sawtooth-simulator-builder /project/consensus/poet/python3-sawtooth-poet-simulator*.deb /tmp 251 COPY --from=poet-core-builder /project/consensus/poet/python3-sawtooth-poet-core*.deb /tmp 252 COPY --from=poet-cli-builder /project/consensus/poet/python3-sawtooth-poet-cli*.deb /tmp 253 254 RUN echo "deb http://repo.sawtooth.me/ubuntu/ci xenial universe" >> /etc/apt/sources.list \ 255 && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \ 256 || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \ 257 && apt-get update \ 258 && dpkg -i /tmp/python3-sawtooth*.deb || true \ 259 && apt-get -f -y install \ 260 && apt-get clean \ 261 && rm -rf /var/lib/apt/lists/*