Skip to content

Commit

Permalink
Install nohang from source for ubuntu
Browse files Browse the repository at this point in the history
nohang apt repo is not actively maintained, install it from source instead.

try to fix kairos-io#2195

Signed-off-by: Liyi Meng <[email protected]>
  • Loading branch information
liyimeng committed Mar 8, 2024
1 parent a1f2e3d commit f4b506e
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions images/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,29 @@ FROM ${BASE_IMAGE} AS ubuntu-20.04-upstream

FROM ${BASE_IMAGE} AS ubuntu-22.04-upstream

###############################################################
#### build nohang from source ####
###############################################################
FROM ubuntu-22.04-upstream as nohang-builder
WORKDIR /root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
make fakeroot git ca-certificates

RUN git clone -b master --depth=1 https://github.com/hakavlad/nohang.git \
&& cd nohang \
&& echo > deb/DEBIAN/postinst \
&& deb/build.sh

###############################################################
#### Pre-Process Common to All ####
###############################################################
FROM ${FLAVOR}-${FLAVOR_RELEASE}-upstream AS common
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gnupg \
software-properties-common \
&& add-apt-repository ppa:oibaf/test \
&& apt-get update \
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gnupg \
conntrack \
console-data \
cloud-guest-utils \
Expand All @@ -71,7 +80,6 @@ RUN apt-get update \
lvm2 \
nano \
nbd-client \
nohang \
open-iscsi \
open-vm-tools \
openssh-server \
Expand All @@ -85,9 +93,15 @@ RUN apt-get update \
ubuntu-advantage-tools \
xz-utils \
zstd \
zfsutils-linux \
tpm2-* \
&& apt-get remove -y unattended-upgrades && apt-get clean && rm -rf /var/lib/apt/lists/*

# Install nohang
COPY --from=nohang-builder /root/nohang/deb/package.deb /tmp/nohang.deb
RUN apt install -y --no-install-recommends /tmp/nohang.deb
RUN rm -rf /tmp/nohang.deb

# This target is aimed at UKI images and avoids to install GRUB and any other unnecesary packages
# to the image because there are limitations on the total size
FROM common AS systemd-boot
Expand Down

0 comments on commit f4b506e

Please sign in to comment.