Skip to content

Commit bc4bf3c

Browse files
authored
feat: include python3-pexpect in our kairos image (#511)
This is needed for the [`ansible.builtin.expect`](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/expect_module.html) module to work, which I am working on a play for to have our encrypted longhorn volumes be trim-able.
1 parent 29589db commit bc4bf3c

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

images/kairos-ubuntu/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
FROM quay.io/kairos/kairos-init:v0.5.20@sha256:d90e8dd3d43f8c90b4cc9f76b1eb7282823737867dfdf5dda88a66c7683bccfc AS kairos-init
44

5+
# Allow build scripts to be referenced without being copied into the final image.
6+
FROM scratch AS ctx
7+
COPY build_files /
8+
59
FROM ubuntu:24.04@sha256:fdb6c9ceb1293dcb0b7eda5df195b15303b01857d7b10f98489e7691d20aa2a1 AS base-kairos
610
LABEL org.opencontainers.image.title="A custom Ubuntu-based Kairos image."
711
LABEL org.opencontainers.image.title="kairos-ubuntu"
@@ -26,7 +30,12 @@ RUN /kairos-init \
2630
--version "${VERSION}"
2731

2832
# Our customizations!
29-
# This space intentionally left blank.
33+
# hadolint ignore=DL3059
34+
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
35+
--mount=type=cache,dst=/var/cache \
36+
--mount=type=cache,dst=/var/log \
37+
--mount=type=tmpfs,dst=/tmp \
38+
/ctx/customization.sh
3039

3140
# Initialize the image.
3241
# hadolint ignore=DL3059
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -ouex pipefail
4+
5+
# Additional Packages
6+
PACKAGES=(
7+
# Used by `ansible.builtin.expect`
8+
"python3-pexpect"
9+
)
10+
11+
apt-get update
12+
apt-get upgrade -y
13+
apt-get install -y --no-install-recommends "${PACKAGES[@]}"
14+
15+
# Cleanup
16+
apt-get clean
17+
rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)