mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-05 06:55:30 +00:00
test: add test-containerd
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp> Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
committed by
Rolf Neugebauer
parent
43ac05e4dd
commit
4699f80ef7
32
test/pkg/containerd/Dockerfile
Normal file
32
test/pkg/containerd/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
FROM linuxkit/alpine:24fe1b6bbf1fc95b484741587acb10da6dbc9211 AS mirror
|
||||
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
||||
# btrfs-progfs is required for btrfs test (mkfs.btrfs)
|
||||
# util-linux is required for btrfs test (losetup)
|
||||
RUN apk add --no-cache --initdb -p /out \
|
||||
alpine-baselayout \
|
||||
busybox \
|
||||
btrfs-progs \
|
||||
btrfs-progs-dev \
|
||||
gcc \
|
||||
git \
|
||||
go \
|
||||
libc-dev \
|
||||
linux-headers \
|
||||
make \
|
||||
musl \
|
||||
util-linux
|
||||
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
|
||||
|
||||
FROM scratch
|
||||
COPY --from=mirror /out/ /
|
||||
ENV GOPATH=/go
|
||||
RUN mkdir -p $GOPATH/src/github.com/containerd && \
|
||||
cd $GOPATH/src/github.com/containerd && \
|
||||
git clone https://github.com/containerd/containerd.git
|
||||
WORKDIR $GOPATH/src/github.com/containerd/containerd
|
||||
# CONTAINERD_COMMIT is defined in linuxkit/alpine
|
||||
RUN git checkout $CONTAINERD_COMMIT
|
||||
ADD run.sh ./run.sh
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "run.sh"]
|
||||
LABEL org.mobyproject.config='{"net": "host", "capabilities": ["all"], "tmpfs": ["/tmp:exec"], "binds": ["/dev:/dev"]}'
|
||||
15
test/pkg/containerd/Makefile
Normal file
15
test/pkg/containerd/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
.PHONY: tag push
|
||||
default: push
|
||||
|
||||
ORG?=linuxkit
|
||||
IMAGE=test-containerd
|
||||
DEPS=Dockerfile Makefile run.sh
|
||||
|
||||
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||
|
||||
tag: $(DEPS)
|
||||
docker build --squash --no-cache -t $(ORG)/$(IMAGE):$(HASH) .
|
||||
|
||||
push: tag
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
|
||||
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)
|
||||
11
test/pkg/containerd/run.sh
Executable file
11
test/pkg/containerd/run.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
function failed {
|
||||
printf "containerd test suite FAILED\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# unset -race (does not work on alpine; see golang/go#14481)
|
||||
export TESTFLAGS=
|
||||
make root-test || failed
|
||||
printf "containerd test suite PASSED\n"
|
||||
Reference in New Issue
Block a user