Skip to content

Commit 0c80599

Browse files
committed
Combine runctestimage and runcimage
There is no need that keep them separate, it also fixes #1006. Signed-off-by: Qiang Huang <[email protected]>
1 parent 189a2ab commit 0c80599

File tree

3 files changed

+52
-55
lines changed

3 files changed

+52
-55
lines changed

Dockerfile

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1-
FROM runc_test
1+
FROM golang:1.6.2
2+
3+
# libseccomp in jessie is not _quite_ new enough -- need backports version
4+
RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list
5+
6+
RUN apt-get update && apt-get install -y \
7+
build-essential \
8+
curl \
9+
gawk \
10+
iptables \
11+
pkg-config \
12+
libaio-dev \
13+
libcap-dev \
14+
libprotobuf-dev \
15+
libprotobuf-c0-dev \
16+
libseccomp2/jessie-backports \
17+
libseccomp-dev/jessie-backports \
18+
protobuf-c-compiler \
19+
protobuf-compiler \
20+
python-minimal \
21+
--no-install-recommends
22+
23+
# install bats
24+
RUN cd /tmp \
25+
&& git clone https://github.com/sstephenson/bats.git \
26+
&& cd bats \
27+
&& git reset --hard 03608115df2071fff4eaaff1605768c275e5f81f \
28+
&& ./install.sh /usr/local
29+
30+
# install criu
31+
ENV CRIU_VERSION 1.7
32+
RUN mkdir -p /usr/src/criu \
33+
&& curl -sSL https://github.com/xemul/criu/archive/v${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
34+
&& cd /usr/src/criu \
35+
&& make install-criu
36+
37+
# setup a playground for us to spawn containers in
38+
ENV ROOTFS /busybox
39+
RUN mkdir -p ${ROOTFS} \
40+
&& curl -o- -sSL 'https://github.com/jpetazzo/docker-busybox/raw/buildroot-2014.11/rootfs.tar' | tar -C ${ROOTFS} -xf -
41+
42+
COPY script/tmpmount /
43+
WORKDIR /go/src/github.com/opencontainers/runc
44+
ENTRYPOINT ["/tmpmount"]
45+
246
ADD . /go/src/github.com/opencontainers/runc
3-
RUN make

Makefile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ BINDIR := $(PREFIX)/sbin
77
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
88
GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
99
RUNC_IMAGE := runc_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
10-
RUNC_TEST_IMAGE := runc_test$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
1110
PROJECT := github.com/opencontainers/runc
1211
TEST_DOCKERFILE := script/test_Dockerfile
1312
BUILDTAGS := seccomp
@@ -33,9 +32,8 @@ static: $(RUNC_LINK)
3332
$(RUNC_LINK):
3433
ln -sfn $(CURDIR) $(RUNC_LINK)
3534

36-
dbuild: runctestimage
37-
docker build -t $(RUNC_IMAGE) .
38-
docker create --name=$(RUNC_INSTANCE) $(RUNC_IMAGE)
35+
dbuild: runcimage
36+
docker run --name=$(RUNC_INSTANCE) $(RUNC_IMAGE) make
3937
docker cp $(RUNC_INSTANCE):$(RUNC_BUILD_PATH) .
4038
docker rm $(RUNC_INSTANCE)
4139

@@ -46,23 +44,23 @@ lint:
4644
man:
4745
man/md2man-all.sh
4846

49-
runctestimage:
50-
docker build -t $(RUNC_TEST_IMAGE) -f $(TEST_DOCKERFILE) .
47+
runcimage:
48+
docker build -t $(RUNC_IMAGE) .
5149

5250
test:
5351
make unittest integration
5452

5553
localtest:
5654
make localunittest localintegration
5755

58-
unittest: runctestimage
59-
docker run -e TESTFLAGS -ti --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_TEST_IMAGE) make localunittest
56+
unittest: runcimage
57+
docker run -e TESTFLAGS -ti --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest
6058

6159
localunittest: all
6260
go test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v ./...
6361

6462
integration: runctestimage
65-
docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_TEST_IMAGE) make localintegration
63+
docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration
6664

6765
localintegration: all
6866
bats -t tests/integration${TESTFLAGS}

script/test_Dockerfile

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)