提交 0e94f045 编写于 作者: F Felix Abecassis

Add support for Debian Stretch

上级 a4ec6ebb
FROM debian:stretch
# runc dependencies
RUN apt-get update && apt-get install -y \
wget \
git \
make \
pkg-config \
gcc \
libseccomp-dev \
libapparmor-dev \
libselinux1-dev && \
rm -rf /var/lib/apt/lists/*
ENV GOLANG_VERSION 1.9.2
RUN wget -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz \
| tar -v -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get github.com/LK4D4/vndr
# packaging dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
dh-make \
fakeroot \
devscripts && \
rm -rf /var/lib/apt/lists/*
# packaging
ARG PKG_VERS
ARG PKG_REV
ARG PKG_ARCH
ENV DEBFULLNAME "NVIDIA CORPORATION"
ENV DEBEMAIL "cudatools@nvidia.com"
ENV REVISION "$PKG_VERS-$PKG_REV"
ENV DISTRIB "UNRELEASED"
ENV SECTION ""
# output directory
ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS
RUN mkdir -p $DIST_DIR
# runc
WORKDIR $GOPATH/src/github.com/opencontainers/runc
ARG RUNC_COMMIT
COPY runc/$RUNC_COMMIT/ /tmp/patches/runc
RUN git clone https://github.com/docker/runc.git . && \
git checkout $RUNC_COMMIT && \
git apply /tmp/patches/runc/* && \
if [ -f vendor.conf ]; then vndr; fi && \
make BUILDTAGS="seccomp apparmor selinux" && \
mv runc $DIST_DIR/nvidia-container-runtime
# nvidia-container-runtime-hook
COPY nvidia-container-runtime-hook/ $GOPATH/src/nvidia-container-runtime-hook
RUN go get -v nvidia-container-runtime-hook && \
mv $GOPATH/bin/nvidia-container-runtime-hook $DIST_DIR/nvidia-container-runtime-hook
COPY config.toml.stretch $DIST_DIR/config.toml
WORKDIR $DIST_DIR
COPY debian ./debian
RUN dch --create --package nvidia-container-runtime -v "$REVISION" "v$REVISION" -D "$DISTRIB" && \
dch -r ""
CMD debuild -eSECTION --dpkg-buildpackage-hook='sh debian/prepare' -i -us -uc -b && \
mv /tmp/nvidia-container-runtime_*.deb /dist
......@@ -10,12 +10,14 @@ DIST_DIR := $(CURDIR)/dist
.NOTPARALLEL:
.PHONY: all
all: xenial centos7
all: xenial centos7 stretch
xenial: 17.09.0-xenial 17.06.2-xenial 17.03.2-xenial 1.13.1-xenial 1.12.6-xenial
centos7: 17.09.0-centos7 17.06.2-centos7 17.03.2-centos7 1.12.6-centos7
stretch: 17.09.0-stretch 17.06.2-stretch 17.03.2-stretch
17.09.0-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.0" \
......@@ -82,3 +84,24 @@ centos7: 17.09.0-centos7 17.06.2-centos7 17.03.2-centos7 1.12.6-centos7
--build-arg PKG_REV="$(PKG_REV).docker1.12.6" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.09.0-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
17.06.2-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="810190ceaa507aa2727d7ae6f4790c76ec150bd2" \
--build-arg PKG_VERS="$(VERSION)+docker17.06.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
17.03.2-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="54296cf40ad8143b62dbcaa1d90e520a2136ddfe" \
--build-arg PKG_VERS="$(VERSION)+docker17.03.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
#path = "/usr/bin/nvidia-container-cli"
environment = []
load-kmods = true
disable-require = false
#debug = "/var/log/nvidia-container-runtime-hook.log"
[configure]
ldconfig = "@/sbin/ldconfig"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册