mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-25 05:21:33 +00:00
69a1a9ef7a
Signed-off-by: Evan Lezar <elezar@nvidia.com>
46 lines
1.2 KiB
Docker
46 lines
1.2 KiB
Docker
ARG BASEIMAGE
|
|
FROM ${BASEIMAGE}
|
|
|
|
# packaging dependencies
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
dh-make \
|
|
fakeroot \
|
|
build-essential \
|
|
devscripts \
|
|
lsb-release && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# packaging
|
|
ARG PKG_NAME
|
|
ARG PKG_VERS
|
|
ARG PKG_REV
|
|
ARG TOOLKIT_VERSION
|
|
ARG DOCKER_VERSION
|
|
|
|
ENV DEBFULLNAME "NVIDIA CORPORATION"
|
|
ENV DEBEMAIL "cudatools@nvidia.com"
|
|
ENV PKG_NAME "${PKG_NAME}"
|
|
ENV REVISION "$PKG_VERS-$PKG_REV"
|
|
ENV DOCKER_VERSION $DOCKER_VERSION
|
|
ENV TOOLKIT_VERSION $TOOLKIT_VERSION
|
|
ENV SECTION ""
|
|
|
|
# output directory
|
|
ENV DIST_DIR=/tmp/${PKG_NAME}-$PKG_VERS
|
|
RUN mkdir -p $DIST_DIR /dist
|
|
|
|
WORKDIR $DIST_DIR
|
|
COPY debian ./debian
|
|
|
|
RUN sed -i "s;@TOOLKIT_VERSION@;${TOOLKIT_VERSION};" debian/control && \
|
|
dch --create --package="${PKG_NAME}" \
|
|
--newversion "${REVISION}" \
|
|
"Bump nvidia-container-toolkit dependency to ${TOOLKIT_VERSION}" && \
|
|
dch -r "" && \
|
|
if [ "$REVISION" != "$(dpkg-parsechangelog --show-field=Version)" ]; then exit 1; fi
|
|
|
|
CMD export DISTRIB="$(lsb_release -cs)" && \
|
|
debuild --preserve-env --dpkg-buildpackage-hook='sh debian/prepare' -i -us -uc -b && \
|
|
mv /tmp/*.deb /dist
|