Merge pull request #1008 from hqhq/combine_runc_image
Combine runctestimage and runcimage
This commit is contained in:
commit
795d5ce2da
47
Dockerfile
47
Dockerfile
|
@ -1,3 +1,46 @@
|
|||
FROM runc_test
|
||||
FROM golang:1.7.0
|
||||
|
||||
# libseccomp in jessie is not _quite_ new enough -- need backports version
|
||||
RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
gawk \
|
||||
iptables \
|
||||
pkg-config \
|
||||
libaio-dev \
|
||||
libcap-dev \
|
||||
libprotobuf-dev \
|
||||
libprotobuf-c0-dev \
|
||||
libseccomp2/jessie-backports \
|
||||
libseccomp-dev/jessie-backports \
|
||||
protobuf-c-compiler \
|
||||
protobuf-compiler \
|
||||
python-minimal \
|
||||
--no-install-recommends
|
||||
|
||||
# install bats
|
||||
RUN cd /tmp \
|
||||
&& git clone https://github.com/sstephenson/bats.git \
|
||||
&& cd bats \
|
||||
&& git reset --hard 03608115df2071fff4eaaff1605768c275e5f81f \
|
||||
&& ./install.sh /usr/local
|
||||
|
||||
# install criu
|
||||
ENV CRIU_VERSION 1.7
|
||||
RUN mkdir -p /usr/src/criu \
|
||||
&& curl -sSL https://github.com/xemul/criu/archive/v${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
|
||||
&& cd /usr/src/criu \
|
||||
&& make install-criu
|
||||
|
||||
# setup a playground for us to spawn containers in
|
||||
ENV ROOTFS /busybox
|
||||
RUN mkdir -p ${ROOTFS} \
|
||||
&& curl -o- -sSL 'https://github.com/jpetazzo/docker-busybox/raw/buildroot-2014.11/rootfs.tar' | tar -C ${ROOTFS} -xf -
|
||||
|
||||
COPY script/tmpmount /
|
||||
WORKDIR /go/src/github.com/opencontainers/runc
|
||||
ENTRYPOINT ["/tmpmount"]
|
||||
|
||||
ADD . /go/src/github.com/opencontainers/runc
|
||||
RUN make
|
||||
|
|
16
Makefile
16
Makefile
|
@ -7,7 +7,6 @@ BINDIR := $(PREFIX)/sbin
|
|||
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||
GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
|
||||
RUNC_IMAGE := runc_dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
|
||||
RUNC_TEST_IMAGE := runc_test$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
|
||||
PROJECT := github.com/opencontainers/runc
|
||||
TEST_DOCKERFILE := script/test_Dockerfile
|
||||
BUILDTAGS := seccomp
|
||||
|
@ -33,9 +32,8 @@ static: $(RUNC_LINK)
|
|||
$(RUNC_LINK):
|
||||
ln -sfn $(CURDIR) $(RUNC_LINK)
|
||||
|
||||
dbuild: runctestimage
|
||||
docker build -t $(RUNC_IMAGE) .
|
||||
docker create --name=$(RUNC_INSTANCE) $(RUNC_IMAGE)
|
||||
dbuild: runcimage
|
||||
docker run --name=$(RUNC_INSTANCE) $(RUNC_IMAGE) make
|
||||
docker cp $(RUNC_INSTANCE):$(RUNC_BUILD_PATH) .
|
||||
docker rm $(RUNC_INSTANCE)
|
||||
|
||||
|
@ -46,8 +44,8 @@ lint:
|
|||
man:
|
||||
man/md2man-all.sh
|
||||
|
||||
runctestimage:
|
||||
docker build -t $(RUNC_TEST_IMAGE) -f $(TEST_DOCKERFILE) .
|
||||
runcimage:
|
||||
docker build -t $(RUNC_IMAGE) .
|
||||
|
||||
test:
|
||||
make unittest integration
|
||||
|
@ -55,14 +53,14 @@ test:
|
|||
localtest:
|
||||
make localunittest localintegration
|
||||
|
||||
unittest: runctestimage
|
||||
docker run -e TESTFLAGS -ti --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_TEST_IMAGE) make localunittest
|
||||
unittest: runcimage
|
||||
docker run -e TESTFLAGS -ti --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest
|
||||
|
||||
localunittest: all
|
||||
go test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v ./...
|
||||
|
||||
integration: runctestimage
|
||||
docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_TEST_IMAGE) make localintegration
|
||||
docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration
|
||||
|
||||
localintegration: all
|
||||
bats -t tests/integration${TESTFLAGS}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
FROM golang:1.6.2
|
||||
|
||||
# libseccomp in jessie is not _quite_ new enough -- need backports version
|
||||
RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
gawk \
|
||||
iptables \
|
||||
pkg-config \
|
||||
libaio-dev \
|
||||
libcap-dev \
|
||||
libprotobuf-dev \
|
||||
libprotobuf-c0-dev \
|
||||
libseccomp2/jessie-backports \
|
||||
libseccomp-dev/jessie-backports \
|
||||
protobuf-c-compiler \
|
||||
protobuf-compiler \
|
||||
python-minimal \
|
||||
--no-install-recommends
|
||||
|
||||
# install bats
|
||||
RUN cd /tmp \
|
||||
&& git clone https://github.com/sstephenson/bats.git \
|
||||
&& cd bats \
|
||||
&& git reset --hard 03608115df2071fff4eaaff1605768c275e5f81f \
|
||||
&& ./install.sh /usr/local
|
||||
|
||||
# install criu
|
||||
ENV CRIU_VERSION 1.7
|
||||
RUN mkdir -p /usr/src/criu \
|
||||
&& curl -sSL https://github.com/xemul/criu/archive/v${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \
|
||||
&& cd /usr/src/criu \
|
||||
&& make install-criu
|
||||
|
||||
# setup a playground for us to spawn containers in
|
||||
ENV ROOTFS /busybox
|
||||
RUN mkdir -p ${ROOTFS} \
|
||||
&& curl -o- -sSL 'https://github.com/jpetazzo/docker-busybox/raw/buildroot-2014.11/rootfs.tar' | tar -C ${ROOTFS} -xf -
|
||||
|
||||
COPY script/tmpmount /
|
||||
WORKDIR /go/src/github.com/opencontainers/runc
|
||||
ENTRYPOINT ["/tmpmount"]
|
Loading…
Reference in New Issue