mirror of
https://github.com/LdDl/go-darknet.git
synced 2025-10-07 16:40:54 +08:00
fix commit, add golang to dockerfile.gpu
This commit is contained in:
@@ -1,33 +1,44 @@
|
|||||||
# Build phase
|
# Build phase
|
||||||
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 as builder
|
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 as builder
|
||||||
|
|
||||||
ENV darknet_commit=680d3bd
|
ENV darknet_commit=a234a5022333c930de08f2470184ef4e0c68356e
|
||||||
|
|
||||||
WORKDIR /root/build
|
WORKDIR /root/build
|
||||||
COPY Makefile.gpu .
|
COPY Makefile.gpu .
|
||||||
RUN apt-get -y update && \
|
RUN apt-get -y update && \
|
||||||
apt-get -y install git build-essential && \
|
apt-get -y install git build-essential && \
|
||||||
git clone https://github.com/pjreddie/darknet.git && \
|
git clone https://github.com/AlexeyAB/darknet.git && \
|
||||||
cd darknet && \
|
cd darknet && \
|
||||||
git checkout $darknet_commit && \
|
git checkout $darknet_commit && \
|
||||||
cp -f /root/build/Makefile.gpu Makefile && \
|
cp -f /root/build/Makefile.gpu Makefile && \
|
||||||
make
|
make
|
||||||
|
|
||||||
# Final Image
|
# Final Image
|
||||||
FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
|
FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
COPY --from=builder /root/build/darknet/darknet \
|
COPY --from=builder /root/build/darknet/darknet \
|
||||||
/root/build/darknet/libdarknet.so \
|
/root/build/darknet/libdarknet.so \
|
||||||
/root/build/darknet/libdarknet.a \
|
|
||||||
/root/build/darknet/include/darknet.h \
|
/root/build/darknet/include/darknet.h \
|
||||||
./staging/
|
./staging/
|
||||||
|
|
||||||
RUN mv staging/darknet /usr/local/bin && \
|
RUN mv staging/darknet /usr/local/bin && \
|
||||||
mv staging/darknet.h /usr/local/include && \
|
mv staging/darknet.h /usr/include && \
|
||||||
mv staging/libdarknet.so staging/libdarknet.a /usr/local/lib && \
|
mv staging/libdarknet.so /usr/lib && \
|
||||||
rm -rf staging
|
rm -rf staging
|
||||||
|
|
||||||
|
WORKDIR /tmp
|
||||||
|
RUN cd /tmp \
|
||||||
|
&& apt-get -y update \
|
||||||
|
&& apt-get install -y wget git gcc \
|
||||||
|
&& wget https://dl.google.com/go/go1.14.linux-amd64.tar.gz \
|
||||||
|
&& tar -xvf go1.14.linux-amd64.tar.gz \
|
||||||
|
&& mv go /usr/local
|
||||||
|
|
||||||
|
ENV GOROOT=/usr/local/go
|
||||||
|
ENV GOPATH=/go
|
||||||
|
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
|
||||||
|
|
||||||
RUN go get -u github.com/LdDl/go-darknet \
|
RUN go get -u github.com/LdDl/go-darknet \
|
||||||
&& go get -u github.com/disintegration/imaging
|
&& go get -u github.com/disintegration/imaging
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user