github.com/mirantis/virtlet@v1.5.2-0.20191204181327-1659b8a48e9b/images/Dockerfile.build-base (about)

     1  # TODO: generate this tag. unfortunately can't use ARG:
     2  # https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
     3  # (but add a note about it here for the future)
     4  FROM mirantis/virtlet-base:v1-6348ee2277c565d3895260bccb5ada96
     5  MAINTAINER Ivan Shvedunov <ishvedunov@mirantis.com>
     6  
     7  LABEL virtlet.image="build-base"
     8  
     9  ENV DOCKER_CLIENT_VERSION 17.03.0-ce
    10  ENV DOCKER_CLIENT_DOWNLOAD_URL_BASE https://download.docker.com/linux/static/stable
    11  ENV DOCKER_CLIENT_SHA256 27f6cbbe189fd6374bedbc406df48462e34d7e6ab2c8c6cc4135c38eb63b0b5d
    12  # TODO: bump kubectl
    13  ENV KUBECTL_VERSION v1.9.3
    14  ENV KUBECTL_SHA1 a27d808eb011dbeea876fe5326349ed167a7ed28
    15  ENV OLD_KUBECTL_VERSION v1.7.12
    16  ENV OLD_KUBECTL_SHA1 385229d4189e4f7978de42f237d6c443c0534edd
    17  
    18  # Go installation commands are based on official Go container:
    19  # https://github.com/docker-library/golang/blob/18ee81a2ec649dd7b3d5126b24eef86bc9c86d80/1.7/Dockerfile
    20  ENV GOLANG_VERSION 1.10.3
    21  ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
    22  ENV GOLANG_DOWNLOAD_SHA256 fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035
    23  
    24  ENV CIRROS_SHA256 fcd9e9a622835de8dba6b546481d13599b1e592bba1275219e1b31cae33b1365
    25  
    26  RUN apt-get update && \
    27      DEBIAN_FRONTEND=noninteractive apt-get install -y \
    28                  git \
    29                  make \
    30                  autoconf \
    31                  automake \
    32                  p7zip-full \
    33                  dhcpcd5 \
    34                  tcpdump \
    35                  iputils-ping \
    36                  mercurial \
    37                  pkg-config \
    38                  python-pip && \
    39      apt-get clean && \
    40      pip install mkdocs
    41  
    42  # Install docker client
    43  RUN mkdir -p /usr/local/bin && \
    44      curl -sSL "${DOCKER_CLIENT_DOWNLOAD_URL_BASE}/$(uname -m)/docker-${DOCKER_CLIENT_VERSION}.tgz" | \
    45      tar -C /usr/local/bin -xz --strip-components=1 docker/docker && \
    46      echo "${DOCKER_CLIENT_SHA256}  /usr/local/bin/docker" | sha256sum -c -
    47  
    48  # Install Go
    49  RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
    50  	&& echo "$GOLANG_DOWNLOAD_SHA256  golang.tar.gz" | sha256sum -c - \
    51  	&& tar -C /usr/local -xzf golang.tar.gz \
    52  	&& rm golang.tar.gz
    53  
    54  ENV GOPATH /go
    55  ENV PATH /go/src/github.com/Mirantis/virtlet/_output:$GOPATH/bin:/usr/local/go/bin:$PATH
    56  
    57  RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
    58  WORKDIR $GOPATH
    59  
    60  # Install kubectl.
    61  # Also install old kubectl for v1.7 (needed to make the release yaml)
    62  RUN curl -L https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && \
    63      echo "${KUBECTL_SHA1}  /usr/local/bin/kubectl" | sha1sum -c && \
    64      chmod +x /usr/local/bin/kubectl && \
    65      curl -L https://storage.googleapis.com/kubernetes-release/release/${OLD_KUBECTL_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl.old && \
    66      echo "${OLD_KUBECTL_SHA1}  /usr/local/bin/kubectl.old" | sha1sum -c && \
    67      chmod +x /usr/local/bin/kubectl.old
    68  
    69  # TODO: update CNI ver
    70  RUN mkdir -p ~/.ssh && \
    71      ssh-keyscan github.com >> ~/.ssh/known_hosts && \
    72      mkdir -p /var/lib/virtlet/volumes /opt/cni/bin && \
    73      curl -L https://github.com/containernetworking/cni/releases/download/v0.3.0/cni-v0.3.0.tgz | \
    74        tar zxC /opt/cni/bin && \
    75      ln -s /go/src/github.com/Mirantis/virtlet/_output/vmwrapper /vmwrapper
    76  
    77  # Download cirros image
    78  RUN mkdir -p /images && \
    79      curl -L https://github.com/Mirantis/virtlet/releases/download/v0.8.2/cirros.img -o /images/cirros.img && \
    80      echo "${CIRROS_SHA256}  /images/cirros.img" | sha256sum -c -
    81  
    82  # Install Go tooling
    83  RUN go get github.com/aktau/github-release && \
    84      go get github.com/Masterminds/glide && \
    85      go get github.com/go-bindata/go-bindata/...