forked from NVIDIA/nvidia-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.rpm.ppc64le
47 lines (40 loc) · 1.27 KB
/
Dockerfile.rpm.ppc64le
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
46
47
FROM ibmcom/centos-ppc64le:7
RUN yum install -y \
vim \
rpm-build && \
rm -rf /var/cache/yum/*
RUN sed -i 's/include_release_info = 1/include_release_info = 0/' /usr/share/vim/vim74/ftplugin/spec.vim && \
echo 'let g:spec_chglog_format = "%a %b %d %Y ".$VENDOR." <".$EMAIL."> ".$VERSION."-".$REVISION' >> /etc/vimrc && \
echo 'autocmd VimEnter *.spec execute "normal \\c"' >> /etc/vimrc
ARG USER_ID
ARG CR_NAME
ARG CR_EMAIL
ARG PKG_NAME
ARG PKG_VERS
ARG PKG_REV
ARG PKG_ARCH
VOLUME /dist
VOLUME /build
WORKDIR /tmp/$PKG_NAME-$PKG_VERS
ENV VENDOR $CR_NAME
ENV EMAIL $CR_EMAIL
ENV NAME $PKG_NAME
ENV VERSION $PKG_VERS
ENV REVISION $PKG_REV
ENV ARCHITECTURE $PKG_ARCH
RUN useradd --non-unique --uid $USER_ID nvidia && chown nvidia: .
USER nvidia
CMD read -p "Update changelog (y/n)? " yn && [ "$yn" = "y" ] && \
vim /build/rpm/SPECS/$NAME.spec ; \
cp -Lr /build/rpm/* . && \
cp /dist/*.tar.xz SOURCES && \
rpmbuild --clean -bb \
-D "_topdir $PWD" \
-D "vendor $VENDOR" \
-D "email $EMAIL" \
-D "name $NAME" \
-D "version $VERSION" \
-D "revision $REVISION" \
-D "architecture $ARCHITECTURE" \
SPECS/$NAME.spec && \
mv RPMS/$ARCHITECTURE/*.rpm /dist