Skip to content

Commit 591e52c

Browse files
Merge pull request #3185 from thaJeztah/update_dev_dockerfile
Update contrib/Dockerfile.test
2 parents eea500d + 2741dbe commit 591e52c

1 file changed

Lines changed: 34 additions & 12 deletions

File tree

contrib/Dockerfile.test

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,48 @@
66
# 3.) $ make binaries install test
77
#
88

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+
915
# 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+
1225
COPY script/setup/install-protobuf install-protobuf
1326
RUN ./install-protobuf
1427

1528
# 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
1936
COPY script/setup/install-runc install-runc
2037
RUN ./install-runc
2138

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
2448

25-
COPY --from=proto3 /usr/local/bin/protoc /usr/local/bin/protoc
49+
COPY --from=proto3 /usr/local/bin/protoc /usr/local/bin/protoc
2650
COPY --from=proto3 /usr/local/include/google /usr/local/include/google
51+
COPY --from=runc /usr/local/sbin/runc /usr/local/go/bin/runc
2752

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

Comments
 (0)