-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.calaos-os
86 lines (69 loc) · 3.22 KB
/
Dockerfile.calaos-os
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM debian:bookworm-slim
# Set TERM environment variable
ENV TERM=xterm-color
ARG UID=1001
ARG GID=1001
ARG VERSION
#Enable all repo (non-free)
RUN sed -i 's/^Components: main$/Components: main contrib non-free non-free-firmware/g' /etc/apt/sources.list.d/debian.sources
RUN apt -y update && \
apt -y upgrade && \
apt-get install -yq --no-install-recommends ca-certificates wget gnupg curl \
openssh-server systemd systemd-container systemd-timesyncd systemd-resolved systemd-sysv \
iproute2 bridge-utils ethtool net-tools iputils-ping libgpgme11 libyajl2 \
nano git fuse-overlayfs grub-efi zstd less htop \
e2fsprogs cloud-guest-utils kbd gpg pciutils
RUN curl -fsSL https://deb.calaos.fr/calaos/calaos-container/archive.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/calaos.gpg && \
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/calaos.gpg] https://deb.calaos.fr/calaos/calaos-container bookworm releases' > /etc/apt/sources.list.d/calaos.list && \
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/calaos.gpg] https://deb.calaos.fr/calaos/calaos_ddns bookworm releases' >> /etc/apt/sources.list.d/calaos.list && \
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/calaos.gpg] https://deb.calaos.fr/calaos/pkgdebs bookworm releases' >> /etc/apt/sources.list.d/calaos.list && \
apt -y update && \
touch /tmp/calaos-os.container.install && \
DEBIAN_FRONTEND=noninteractive apt-get -yqq -o DPkg::Options::="--force-confnew" install calaos && \
rm -rf /tmp/calaos-os.container.install
COPY calaos-os/services/config.network /etc/systemd/network/config.network
# Set default root password
RUN echo 'root:calaos' | chpasswd
RUN systemctl enable \
systemd-networkd \
ssh
# Enable root login for SSH
RUN sed -i 's/.*PermitRootLogin .*$/PermitRootLogin yes/g' /etc/ssh/sshd_config
# Set nano as default editor
RUN echo "export EDITOR=nano \n\
export VISUAL=nano \n\
alias ll='ls -l' \n\
" > /etc/bash.bashrc
# Set os-release
RUN echo 'NAME="Calaos OS '$VERSION'"\n\
PRETTY_NAME="Calaos OS"\n\
VERSION="'$VERSION'"\n\
VERSION_ID="Calaos OS 4"\n\
ID=debian\n\
ID_LIKE=debian\n\
ANSI_COLOR="38;2;23;147;209"\n\
HOME_URL="https://calaos.fr"\n\
DOCUMENTATION_URL="https://calaos.fr"\n\
SUPPORT_URL="https://calaos.fr"\n\
BUG_REPORT_URL="https://calaos.fr"\n\
LOGO=debian-logo\n\
' > /usr/lib/os-release
RUN curl -fsSL https://starship.rs/install.sh | sh -s -- -y
RUN echo 'eval "$(starship init bash)"' >> /root/.bashrc
#Reset systemd (see: https://systemd.io/BUILDING_IMAGES/)
RUN echo "uninitialized" > /etc/machine-id && \
rm -fr /var/lib/systemd/random-seed
RUN mkdir /tmp/images/
# Initramfs hook to resize rootfs
RUN mkdir -p /usr/share/initramfs-tools/scripts/local-bottom
COPY calaos-os/initramfs/install_hook/grow_root /usr/share/initramfs-tools/hooks/resizeroot
COPY calaos-os/initramfs/run_hook/grow_root /usr/share/initramfs-tools/scripts/local-bottom/resizeroot
#enable the resize
RUN touch /etc/calaos-resize
#better bash history search with up/down arrows
COPY calaos-os/config/inputrc /root/.inputrc
#RUN mkdir -p /etc/systemd/logind.conf.d && \
# echo "[Login]\n\
# NAutoVTs=1\n\
# ReserveVT=1\n\
# " > /etc/systemd/logind.conf.d/calaos.conf