Dockerfile 1.39 KiB
ARG DEBIAN_VERSION=buster
FROM debian:${DEBIAN_VERSION}
RUN sed -i -e '/^Templates:/aFrontend: noninteractive' /etc/debconf.conf
ARG http_proxy
RUN if [ -n "$http_proxy" ] ; then echo 'Acquire::http::Proxy "'$http_proxy'";' >/etc/apt/apt.conf.d/80proxies ; fi
RUN echo 'Acquire::https::Proxy "DIRECT";' >>/etc/apt/apt.conf.d/80proxies
RUN apt-get update -yqq
RUN apt-get install -yqq systemd sudo locales
RUN ln -snf /lib/systemd/systemd /sbin/init
RUN sed -e '/NAutoVTs=/cNAutoVTs=0' -e '/ReserveVTs=/cReserveVT=0' /etc/systemd/logind.conf
RUN mkdir -p /var/log/journal/
RUN echo "C UTF-8\nfr_FR UTF-8" >/etc/locale.gen \
  && locale-gen \
  && update-locale LANG=fr_FR.UTF-8
ENV LANG=fr_FR.UTF-8
STOPSIGNAL SIGRTMIN+3
#CMD ["/sbin/init", "--log-target=console", "--default-standard-output=tty", "--default-standard-error=tty"]
CMD ["/sbin/init"]
HEALTHCHECK --interval=1s --timeout=5s --start-period=10s --retries=3 CMD ["/bin/sh", "-c", "systemctl is-system-running | tee /dev/stderr | grep -E 'running|degraded'"]
ARG TEST_USER=devops
ARG TEST_HOME="/home/$TEST_USER"
ARG BDOH_VERSION
RUN useradd -d "$TEST_HOME" -m -s /bin/bash -G www-data,sudo "$TEST_USER"
RUN echo "$TEST_USER ALL = (ALL) NOPASSWD: ALL" >"/etc/sudoers.d/$TEST_USER"
COPY files "$TEST_HOME/files"
COPY bdoh-$BDOH_VERSION.tar.bz2 "$TEST_HOME/bdoh-$BDOH_VERSION.tar.bz2"
COPY script.sh "$TEST_HOME/script.sh"
RUN chmod +x "$TEST_HOME/script.sh"