2022-12-04 14:31:57 +00:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG OS_VERSION=buster
|
|
|
|
|
|
|
|
FROM "debian:${OS_VERSION}-slim"
|
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends sudo systemd rsyslog procps man-db wget git \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
RUN groupadd pi \
|
|
|
|
&& useradd --create-home --shell /bin/bash -g pi pi \
|
|
|
|
&& echo "pi ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
|
2022-12-05 17:58:23 +00:00
|
|
|
&& echo "pi:piscsi" | chpasswd
|
2022-12-04 14:31:57 +00:00
|
|
|
|
2022-12-11 03:31:37 +00:00
|
|
|
# Make mock commands available when executing sudo
|
|
|
|
RUN sed -i 's/^Defaults\tsecure_path="\/usr/Defaults\tsecure_path="\/home\/pi\/piscsi\/python\/web\/mock\/bin:\/usr/' /etc/sudoers
|
2022-12-04 14:31:57 +00:00
|
|
|
|
|
|
|
RUN mkdir -p /home/pi/shared_files \
|
|
|
|
&& mkdir /home/pi/images \
|
|
|
|
&& mkdir -p /etc/network/interfaces.d \
|
|
|
|
&& touch /etc/dhcpcd.conf
|
|
|
|
|
|
|
|
USER pi
|
2022-12-05 17:58:23 +00:00
|
|
|
WORKDIR /home/pi/piscsi
|
2022-12-04 14:31:57 +00:00
|
|
|
|
2022-12-05 17:58:23 +00:00
|
|
|
RUN mkdir /home/pi/piscsi/{python,cpp}
|
2022-12-04 14:31:57 +00:00
|
|
|
COPY --chown=pi:pi easyinstall.sh .
|
|
|
|
COPY --chown=pi:pi cpp/os_integration cpp/os_integration
|
2022-12-05 17:58:23 +00:00
|
|
|
COPY --chown=pi:pi cpp/piscsi_interface.proto cpp/piscsi_interface.proto
|
2022-12-04 14:31:57 +00:00
|
|
|
COPY --chown=pi:pi python/web python/web
|
|
|
|
COPY --chown=pi:pi python/common python/common
|
|
|
|
|
2022-12-05 17:58:23 +00:00
|
|
|
# Install standalone PiSCSI Web UI
|
2022-12-10 05:00:31 +00:00
|
|
|
RUN ./easyinstall.sh --run_choice=12 \
|
2022-12-04 14:31:57 +00:00
|
|
|
&& sudo apt-get remove build-essential --yes \
|
|
|
|
&& sudo apt autoremove -y \
|
|
|
|
&& sudo apt-get clean \
|
|
|
|
&& sudo rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Enable web UI authentication
|
2022-12-10 05:00:31 +00:00
|
|
|
RUN ./easyinstall.sh --run_choice=14
|
2022-12-04 14:31:57 +00:00
|
|
|
|
|
|
|
# Setup wired network bridge
|
|
|
|
RUN ./easyinstall.sh --run_choice=5 --headless
|
|
|
|
|
|
|
|
USER root
|
|
|
|
WORKDIR /home/pi
|
|
|
|
RUN pip3 install --no-cache-dir PyYAML watchdog
|
2022-12-05 17:58:23 +00:00
|
|
|
COPY docker/web/web_start_wrapper.sh /usr/local/bin/web_start_wrapper.sh
|
|
|
|
RUN chmod +x /usr/local/bin/web_start_wrapper.sh
|
2022-12-04 14:31:57 +00:00
|
|
|
|
|
|
|
EXPOSE 80 443
|
2022-12-05 17:58:23 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/web_start_wrapper.sh"]
|
2022-12-04 14:31:57 +00:00
|
|
|
|
|
|
|
HEALTHCHECK --interval=5m --timeout=3s \
|
|
|
|
CMD wget --quiet --server-response http://localhost/healthcheck 2>&1 | grep "200 OK"
|