forked from NVIDIA/nvidia-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.centos
39 lines (31 loc) · 909 Bytes
/
Dockerfile.centos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ARG VERSION_ID
FROM centos:${VERSION_ID}
# packaging dependencies
RUN yum install -y \
rpm-build && \
rm -rf /var/cache/yum/*
# packaging
ARG PKG_VERS
ARG PKG_REV
ARG RUNTIME_VERSION
ARG DOCKER_VERSION
ENV VERSION $PKG_VERS
ENV RELEASE $PKG_REV
ENV DOCKER_VERSION $DOCKER_VERSION
ENV RUNTIME_VERSION $RUNTIME_VERSION
# output directory
ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES
RUN mkdir -p $DIST_DIR /dist
COPY nvidia-docker $DIST_DIR
COPY daemon.json $DIST_DIR
WORKDIR $DIST_DIR/..
COPY rpm .
RUN sed -i "s;@VERSION@;${PKG_VERS};" $DIST_DIR/nvidia-docker
CMD rpmbuild --clean -bb \
-D "_topdir $PWD" \
-D "version $VERSION" \
-D "release $RELEASE" \
-D "docker_version $DOCKER_VERSION" \
-D "runtime_version $RUNTIME_VERSION" \
SPECS/nvidia-docker2.spec && \
mv RPMS/noarch/*.rpm /dist