2020-10-16 00:32:37 +08:00
|
|
|
FROM ubuntu:20.04
|
|
|
|
LABEL maintainer="stephane.lesimple+bastion@ovhcloud.com"
|
|
|
|
|
2020-11-04 19:25:04 +08:00
|
|
|
# cache builds efficiently: just copy the scripts to install packages first
|
2023-09-01 17:25:16 +08:00
|
|
|
COPY bin/admin/install-ttyrec.sh \
|
|
|
|
bin/admin/install-yubico-piv-checker.sh \
|
|
|
|
bin/admin/install-mkhash-helper.sh \
|
|
|
|
bin/admin/packages-check.sh \
|
|
|
|
/opt/bastion/bin/admin/
|
|
|
|
COPY lib/shell /opt/bastion/lib/shell/
|
2020-10-16 00:32:37 +08:00
|
|
|
RUN ["/opt/bastion/bin/admin/packages-check.sh","-i","-d","-s"]
|
2020-11-04 19:25:04 +08:00
|
|
|
RUN ["/opt/bastion/bin/admin/install-ttyrec.sh","-d"]
|
2020-12-30 17:56:41 +08:00
|
|
|
RUN ["/opt/bastion/bin/admin/install-yubico-piv-checker.sh","-d"]
|
2023-09-01 17:25:16 +08:00
|
|
|
RUN ["/opt/bastion/bin/admin/install-mkhash-helper.sh","-d"]
|
2020-10-16 00:32:37 +08:00
|
|
|
|
|
|
|
# handle locales
|
|
|
|
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen
|
|
|
|
|
2020-11-06 01:36:17 +08:00
|
|
|
# disable /dev/kmsg handling by syslog-ng and explicitly enable /dev/log
|
2020-10-16 00:32:37 +08:00
|
|
|
RUN test -e /etc/syslog-ng/syslog-ng.conf && \
|
|
|
|
sed -i -re 's=system\(\);=unix-stream("/dev/log");=' /etc/syslog-ng/syslog-ng.conf
|
|
|
|
|
|
|
|
# at each modification of our code, we'll start from here thanks to build cache
|
|
|
|
COPY . /opt/bastion
|
|
|
|
|
|
|
|
# tests that the environment works
|
|
|
|
RUN ["/opt/bastion/bin/dev/perl-check.sh"]
|
|
|
|
|
|
|
|
# setup ssh/sshd config and setup bastion install
|
2021-06-08 00:38:16 +08:00
|
|
|
RUN ["/opt/bastion/bin/admin/install","--new-install"]
|
2020-10-16 00:32:37 +08:00
|
|
|
|
|
|
|
# start at entrypoint
|
|
|
|
ENTRYPOINT /opt/bastion/docker/entrypoint.sh
|
|
|
|
|
2024-04-10 00:22:41 +08:00
|
|
|
# TESTOPT --has-mfa=1 --has-pamtester=1 --has-piv=1 --has-sk=1
|