lnav/demo/Dockerfile

45 lines
1.5 KiB
Docker
Raw Normal View History

2023-07-03 20:54:50 +00:00
FROM --platform=linux/amd64 debian:11.3-slim
RUN set -eux; \
export DEBIAN_FRONTEND=noninteractive; \
apt update; \
apt install --yes --no-install-recommends bind9-dnsutils iputils-ping iproute2 curl ca-certificates htop wget unzip openssh-server; \
apt clean autoclean; \
apt autoremove --yes; \
rm -rf /var/lib/{apt,dpkg,cache,log}/; \
echo "Installed base utils!"
2023-07-03 16:18:42 +00:00
ADD https://github.com/tstack/lnav/releases/download/v0.11.2/lnav-0.11.2-x86_64-linux-musl.zip /
RUN unzip lnav-0.11.2-x86_64-linux-musl.zip
COPY docs/tutorials tutorials
2022-08-30 23:11:37 +00:00
RUN gunzip /tutorials/playground/logs/*.gz
2022-08-30 23:11:37 +00:00
RUN useradd -rm -d /home/playground -s /bin/bash playground
RUN echo 'playground:playground' | chpasswd
RUN passwd -d playground
RUN useradd -rm -d /home/tutorial1 -s /bin/bash tutorial1
RUN echo 'tutorial1:tutorial1' | chpasswd
RUN passwd -d tutorial1
2022-08-30 23:11:37 +00:00
USER playground
2023-07-03 16:18:42 +00:00
RUN /lnav-0.11.2/lnav -nN -c ":config /ui/theme monocai"
USER tutorial1
2023-07-03 16:18:42 +00:00
RUN /lnav-0.11.2/lnav -nN -c ":config /ui/theme monocai"
USER root
2022-08-30 23:11:37 +00:00
RUN echo 'Match User playground' >> /etc/ssh/sshd_config
2023-07-03 16:18:42 +00:00
RUN echo 'ForceCommand env PATH=/lnav-0.11.2:$PATH /tutorials/playground/run.sh' >> /etc/ssh/sshd_config
RUN echo 'PermitEmptyPasswords yes' >> /etc/ssh/sshd_config
RUN echo 'Match User tutorial1' >> /etc/ssh/sshd_config
2023-07-03 16:18:42 +00:00
RUN echo 'ForceCommand env PATH=/lnav-0.11.2:$PATH /tutorials/tutorial1/run.sh' >> /etc/ssh/sshd_config
RUN echo 'PermitEmptyPasswords yes' >> /etc/ssh/sshd_config
RUN service ssh start
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]