forked from NVIDIA/nvidia-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ubuntu
45 lines (36 loc) · 1.21 KB
/
Dockerfile.ubuntu
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
40
41
42
43
44
45
ARG VERSION_ID
FROM ubuntu:${VERSION_ID}
# packaging dependencies
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_VERS
ARG PKG_REV
ARG RUNTIME_VERSION
ARG RUNTIME_VERSION
ARG DOCKER_VERSION
ENV DEBFULLNAME "NVIDIA CORPORATION"
ENV DEBEMAIL "[email protected]"
ENV REVISION "$PKG_VERS-$PKG_REV"
ENV DOCKER_VERSION $DOCKER_VERSION
ENV RUNTIME_VERSION $RUNTIME_VERSION
ENV SECTION ""
# output directory
ENV DIST_DIR=/tmp/nvidia-docker2-$PKG_VERS
RUN mkdir -p $DIST_DIR /dist
# nvidia-docker 2.0
COPY nvidia-docker $DIST_DIR/nvidia-docker
COPY daemon.json $DIST_DIR/daemon.json
WORKDIR $DIST_DIR
COPY debian ./debian
RUN sed -i "s;@VERSION@;${REVISION};" debian/changelog && \
sed -i "s;@VERSION@;${PKG_VERS};" $DIST_DIR/nvidia-docker && \
if [ "$REVISION" != "$(dpkg-parsechangelog --show-field=Version)" ]; then echo "$(dpkg-parsechangelog --show-field=Version)" && 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