|
6 | 6 | # 3.) $ make binaries install test |
7 | 7 | # |
8 | 8 |
|
| 9 | +ARG GOLANG_VERSION=1.12 |
| 10 | + |
| 11 | +FROM golang:${GOLANG_VERSION} AS golang-base |
| 12 | +RUN mkdir -p /go/src/github.com/containerd/containerd |
| 13 | +WORKDIR /go/src/github.com/containerd/containerd |
| 14 | + |
9 | 15 | # Install proto3 |
10 | | -FROM golang:1.11 AS proto3 |
11 | | -RUN apt-get update && apt-get install -y autoconf automake g++ libtool unzip |
| 16 | +FROM golang-base AS proto3 |
| 17 | +RUN apt-get update && apt-get install -y \ |
| 18 | + autoconf \ |
| 19 | + automake \ |
| 20 | + g++ \ |
| 21 | + libtool \ |
| 22 | + unzip \ |
| 23 | + --no-install-recommends |
| 24 | + |
12 | 25 | COPY script/setup/install-protobuf install-protobuf |
13 | 26 | RUN ./install-protobuf |
14 | 27 |
|
15 | 28 | # Install runc |
16 | | -FROM golang:1.11 AS runc |
17 | | -RUN apt-get update && apt-get install -y curl libseccomp-dev |
18 | | -COPY vendor.conf /go/src/github.com/containerd/containerd/vendor.conf |
| 29 | +FROM golang-base AS runc |
| 30 | +RUN apt-get update && apt-get install -y \ |
| 31 | + curl \ |
| 32 | + libseccomp-dev \ |
| 33 | + --no-install-recommends |
| 34 | + |
| 35 | +COPY vendor.conf vendor.conf |
19 | 36 | COPY script/setup/install-runc install-runc |
20 | 37 | RUN ./install-runc |
21 | 38 |
|
22 | | -FROM golang:1.11 |
23 | | -RUN apt-get update && apt-get install -y btrfs-tools gcc git libseccomp-dev make xfsprogs |
| 39 | +FROM golang-base AS dev |
| 40 | +RUN apt-get update && apt-get install -y \ |
| 41 | + btrfs-tools \ |
| 42 | + gcc \ |
| 43 | + git \ |
| 44 | + libseccomp-dev \ |
| 45 | + make \ |
| 46 | + xfsprogs \ |
| 47 | + --no-install-recommends |
24 | 48 |
|
25 | | -COPY --from=proto3 /usr/local/bin/protoc /usr/local/bin/protoc |
| 49 | +COPY --from=proto3 /usr/local/bin/protoc /usr/local/bin/protoc |
26 | 50 | COPY --from=proto3 /usr/local/include/google /usr/local/include/google |
| 51 | +COPY --from=runc /usr/local/sbin/runc /usr/local/go/bin/runc |
27 | 52 |
|
28 | | -COPY --from=runc /usr/local/sbin/runc /usr/local/go/bin/runc |
29 | | -COPY . /go/src/github.com/containerd/containerd |
30 | | - |
31 | | -WORKDIR /go/src/github.com/containerd/containerd |
| 53 | +COPY . . |
0 commit comments