darknet/Dockerfile.gpu

48 lines
834 B
Docker
Raw Normal View History

FROM nvidia/cuda:11.6.0-cudnn8-devel-ubuntu20.04 AS builder
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y
RUN apt-get install -y g++ make pkg-config libopencv-dev
COPY . /darknet
WORKDIR /darknet
RUN rm Dockerfile.cpu
RUN rm Dockerfile.gpu
2024-05-03 21:41:13 +08:00
RUN rm docker-compose.yml
RUN make
2024-05-03 21:41:13 +08:00
FROM nvidia/cuda:11.6.1-cudnn8-devel-ubuntu20.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y
RUN apt-get install -y sudo libgomp1
RUN useradd -U -m yolo
2024-05-03 21:41:13 +08:00
RUN usermod -aG sudo yolo
RUN usermod --shell /bin/bash yolo
RUN echo "yolo:yolo" | chpasswd
COPY --from=builder /darknet /home/yolo/darknet
RUN cp /home/yolo/darknet/libdarknet.so /usr/local/lib/libdarknet.so || echo "libso not used"
RUN cp /home/yolo/darknet/include/darknet.h /usr/local/include/darknet.h
RUN ldconfig
WORKDIR /home/yolo/darknet
2024-05-03 21:41:13 +08:00
USER yolo