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