2022-12-04 14:31:57 +00:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
FROM debian:bullseye AS build
|
|
|
|
RUN apt-get update && apt-get install --assume-yes --no-install-recommends sudo
|
|
|
|
RUN groupadd pi \
|
|
|
|
&& useradd --create-home --shell /bin/bash -g pi pi \
|
|
|
|
&& echo "pi ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
|
|
|
|
|
|
|
USER pi
|
2022-12-05 17:58:23 +00:00
|
|
|
WORKDIR /home/pi/piscsi
|
2022-12-04 14:31:57 +00:00
|
|
|
|
|
|
|
COPY --chown=pi:pi easyinstall.sh .
|
|
|
|
COPY --chown=pi:pi cpp cpp
|
|
|
|
COPY --chown=pi:pi doc doc
|
2022-12-10 05:00:31 +00:00
|
|
|
RUN ./easyinstall.sh --run_choice=16 --cores=`nproc`
|
2022-12-04 14:31:57 +00:00
|
|
|
|
|
|
|
FROM debian:bullseye-slim AS runner
|
|
|
|
USER root
|
|
|
|
WORKDIR /home/pi
|
|
|
|
|
2023-11-15 06:36:07 +00:00
|
|
|
COPY --from=build /home/pi/piscsi/cpp/bin/* /usr/local/bin/
|
2022-12-05 17:58:23 +00:00
|
|
|
COPY docker/backend/piscsi_wrapper.sh /usr/local/bin/piscsi_wrapper.sh
|
2022-12-04 14:31:57 +00:00
|
|
|
RUN chmod +x /usr/local/bin/*
|
|
|
|
RUN mkdir -p /home/pi/images
|
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install --no-install-recommends --assume-yes libpcap-dev libprotobuf-dev \
|
|
|
|
&& apt autoremove -y \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
EXPOSE 6868
|
2022-12-05 17:58:23 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/piscsi_wrapper.sh", "-r", "7", "-F", "/home/pi/images"]
|
2022-12-04 14:31:57 +00:00
|
|
|
CMD ["-L", "trace"]
|
|
|
|
|
2022-12-05 17:58:23 +00:00
|
|
|
HEALTHCHECK --interval=5m --timeout=1s CMD scsictl -v
|