-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker build for CentOS7 with NVidia GPU
- Loading branch information
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM nvidia/cuda:10.1-devel-centos7 as builder | ||
RUN echo "UPDATE" && yum -y update | ||
RUN echo "DEVTOOLS" && yum -y install \ | ||
git \ | ||
gcc \ | ||
make \ | ||
rpm-build | ||
RUN echo "EXTRAS" && yum -y install \ | ||
libpcap-devel \ | ||
openssl-devel | ||
RUN mkdir /packages && chown 777 /packages | ||
COPY build_hsflowd /root/build_hsflowd | ||
ENTRYPOINT ["/root/build_hsflowd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
echo "build_hsflowd on platform: $1" | ||
echo "with Nvidia NVML extension" | ||
|
||
git clone https://github.com/sflow/host-sflow \ | ||
&& cd host-sflow \ | ||
&& make rpm FEATURES="PCAP TCP DOCKER NVML" | ||
|
||
echo "=== ldd check =========" | ||
ldd src/Linux/mod_nvml.so | ||
echo "=======================" | ||
|
||
for rpm in `ls *.rpm`; do cp "$rpm" "/packages/${rpm/hsflowd/hsflowd-$1}"; done | ||
echo "" | ||
echo "files in /packages:" | ||
ls -l /packages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM nvidia/cuda:10.1-devel-centos7 as builder | ||
RUN echo "UPDATE" && yum -y update | ||
RUN echo "DEVTOOLS" && yum -y install \ | ||
git \ | ||
gcc \ | ||
make | ||
RUN echo "EXTRAS" && yum -y install \ | ||
libpcap-devel \ | ||
openssl-devel | ||
RUN git clone https://github.com/sflow/host-sflow \ | ||
&& cd host-sflow \ | ||
&& make all install FEATURES="PCAP TCP DOCKER NVML" | ||
|
||
FROM nvidia/cuda:10.1-runtime-centos7 | ||
RUN echo "UPDATE" && yum -y update | ||
RUN echo "EXTRAS" && yum -y install \ | ||
libpcap \ | ||
openssl | ||
COPY --from=builder /usr/sbin/hsflowd /usr/sbin/hsflowd | ||
COPY --from=builder /etc/hsflowd.conf /etc/hsflowd.conf | ||
COPY --from=builder /etc/hsflowd/modules/* /etc/hsflowd/modules/ | ||
CMD /usr/sbin/hsflowd -m `uuidgen` -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters