github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/docker/sawtooth-dev-go (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 Go. The default CMD is to run
    18  #   build_go.
    19  #
    20  # Build:
    21  #   $ cd sawtooth-core/docker
    22  #   $ docker build . -f sawtooth-dev-go -t sawtooth-dev-go
    23  #
    24  # Run:
    25  #   $ cd sawtooth-core
    26  #   $ docker run -v $(pwd):/project/sawtooth-core sawtooth-dev-go
    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   && echo "deb http://archive.ubuntu.com/ubuntu xenial-backports universe" >> /etc/apt/sources.list \
    34   && (apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \
    35   || apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 8AA7AF1F1091A5FD) \
    36   && apt-get update \
    37   && apt-get install -y -q --allow-downgrades \
    38      build-essential \
    39      golang-1.9-go \
    40      git \
    41      libssl-dev \
    42      libzmq3-dev \
    43      openssl \
    44      python3-grpcio-tools=1.1.3-1 \
    45   && apt-get clean \
    46   && rm -rf /var/lib/apt/lists/*
    47  
    48  ENV GOPATH=/go:/project/sawtooth-core/sdk/go:/project/sawtooth-core/sdk/examples/intkey_go:/project/sawtooth-core/sdk/examples/noop_go:/project/sawtooth-core/sdk/examples/xo_go
    49  
    50  ENV PATH=$PATH:/project/sawtooth-core/bin:/go/bin:/usr/lib/go-1.9/bin
    51  
    52  RUN mkdir /go
    53  
    54  RUN go get -u \
    55      github.com/golang/protobuf/proto \
    56      github.com/golang/protobuf/protoc-gen-go \
    57      github.com/pebbe/zmq4 \
    58      github.com/brianolson/cbor_go \
    59      github.com/satori/go.uuid \
    60      github.com/btcsuite/btcd/btcec \
    61      github.com/jessevdk/go-flags \
    62      github.com/pelletier/go-toml \
    63      github.com/golang/mock/gomock \
    64      github.com/golang/mock/mockgen \
    65      golang.org/x/crypto/ripemd160 \
    66      golang.org/x/crypto/ssh/terminal \
    67      gopkg.in/fatih/set.v0
    68  
    69  EXPOSE 4004/tcp
    70  
    71  RUN mkdir -p /project/sawtooth-core/ \
    72   && mkdir -p /var/log/sawtooth \
    73   && mkdir -p /var/lib/sawtooth \
    74   && mkdir -p /etc/sawtooth \
    75   && mkdir -p /etc/sawtooth/keys
    76  
    77  WORKDIR /
    78  
    79  CMD build_go && build_smallbank_go