mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
69a1a9ef7a
Signed-off-by: Evan Lezar <elezar@nvidia.com>
37 lines
812 B
Docker
37 lines
812 B
Docker
ARG BASEIMAGE
|
|
FROM ${BASEIMAGE}
|
|
|
|
# packaging dependencies
|
|
RUN yum install -y \
|
|
rpm-build && \
|
|
rm -rf /var/cache/yum/*
|
|
|
|
# packaging
|
|
ARG PKG_NAME
|
|
ARG PKG_VERS
|
|
ARG PKG_REV
|
|
ARG TOOLKIT_VERSION
|
|
ARG DOCKER_VERSION
|
|
|
|
ENV PKG_NAME "${PKG_NAME}"
|
|
ENV VERSION $PKG_VERS
|
|
ENV RELEASE $PKG_REV
|
|
ENV DOCKER_VERSION $DOCKER_VERSION
|
|
ENV TOOLKIT_VERSION $TOOLKIT_VERSION
|
|
|
|
# output directory
|
|
ENV DIST_DIR=/tmp/${PKG_NAME}-$PKG_VERS/SOURCES
|
|
RUN mkdir -p $DIST_DIR /dist
|
|
|
|
WORKDIR $DIST_DIR/..
|
|
COPY rpm .
|
|
|
|
CMD rpmbuild --clean -bb \
|
|
-D "_topdir $PWD" \
|
|
-D "release_date $(date +'%a %b %d %Y')" \
|
|
-D "version $VERSION" \
|
|
-D "release $RELEASE" \
|
|
-D "toolkit_version $TOOLKIT_VERSION" \
|
|
SPECS/nvidia-docker2.spec && \
|
|
mv RPMS/noarch/*.rpm /dist
|