Skip to content

Commit

Permalink
fix(BOUN-1250): ubuntu: add systemd-resolved (#1808)
Browse files Browse the repository at this point in the history
In 24.04 it's shipped as a separate package
  • Loading branch information
blind-oracle authored Oct 2, 2024
1 parent 8bc381d commit 4a1c62f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
35 changes: 16 additions & 19 deletions ic-os/boundary-guestos/context/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ RUN \
# Second build stage:
# - Construct base images with the differences between dev and prod (IC-OS root filesystem)
#
FROM $BASE_IMAGE as image-dev
FROM $BASE_IMAGE AS image-dev
# nns public key will be on the USB stick

FROM $BASE_IMAGE as image-prod
FROM $BASE_IMAGE AS image-prod
USER root:root

# Bake the nns public key into the image
Expand Down Expand Up @@ -118,21 +118,15 @@ RUN for SERVICE in /etc/systemd/system/*; do \
if [ -f "$SERVICE" -a ! -L "$SERVICE" ] && grep -q '^.Install.' "$SERVICE" ; then systemctl enable "${SERVICE#/etc/systemd/system/}" ; fi ; \
done && \
systemctl enable \
ssh \
chrony \
nftables \
systemd-networkd \
systemd-networkd-wait-online \
systemd-resolved \
systemd-journal-gatewayd

# Add user/group entries specified here: /usr/lib/sysusers.d/systemd.conf
# E.g., systemd-timesync/coredump
RUN systemd-sysusers && \
# Fix reproducibility issue. Notes in boundary-guestos/context/Dockerfile
usermod -p '!!' systemd-timesync && \
usermod -p '!!' systemd-coredump && \
# Set /bin/sh to point to /bin/bash instead of the default /bin/dash
echo "set dash/sh false" | debconf-communicate && dpkg-reconfigure -fnoninteractive dash
RUN ln -sf /bin/bash /usr/bin/sh

# Group accounts to which parts of the runtime state are assigned such that
# user accounts can be granted individual access rights.
Expand Down Expand Up @@ -190,15 +184,18 @@ COPY opt /opt
# Clear all files that may lead to indeterministic build.
RUN apt-get clean && \
rm -rf \
/var/cache/fontconfig/* /var/cache/ldconfig/aux-cache \
/var/log/alternatives.log /var/log/apt/history.log \
/var/log/apt/term.log /var/log/dpkg.log \
/var/lib/apt/lists/* /var/lib/dbus/machine-id \
/var/lib/initramfs-tools/5.8.0-50-generic && \
find /usr/local/share/fonts -name .uuid | xargs rm && \
find /usr/share/fonts -name .uuid | xargs rm && \
find /usr/lib -name "*.pyc" | xargs rm -rf&& \
find /usr/share -name "*.pyc" | xargs rm -rf&& \
/var/cache/fontconfig/* \
/var/cache/ldconfig/aux-cache \
/var/log/alternatives.log \
/var/log/apt/history.log \
/var/log/apt/term.log \
/var/log/dpkg.log \
/var/lib/apt/lists/* \
/var/lib/dbus/machine-id && \
find /usr/local/share/fonts -name .uuid -delete && \
find /usr/share/fonts -name .uuid -delete && \
find /usr/lib -name "*.pyc" -delete && \
find /usr/share -name "*.pyc" -delete && \
truncate --size 0 /etc/machine-id

# Update POSIX permissions in /opt
Expand Down
2 changes: 2 additions & 0 deletions ic-os/boundary-guestos/context/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ RUN \
iproute2 \
iputils-ping \
less \
linux-image-virtual-hwe-24.04 \
logrotate \
lshw \
lvm2 \
Expand All @@ -78,6 +79,7 @@ RUN \
systemd \
systemd-sysv \
systemd-journal-remote \
systemd-resolved \
tcpdump \
traceroute \
mtr-tiny \
Expand Down

0 comments on commit 4a1c62f

Please sign in to comment.