@@ -48,7 +48,7 @@ RUN dnf install -y centos-release-nfv-openvswitch && \
48
48
# once microshift is installed so better to disable it because it cause issue when required
49
49
# module is not enabled.
50
50
RUN ${REPO_CONFIG_SCRIPT} ${USHIFT_RPM_REPO_PATH} && \
51
- dnf install -y microshift && \
51
+ dnf install -y microshift microshift-release-info && \
52
52
if [ "$WITH_FLANNEL" -eq 1 ]; then \
53
53
dnf install -y microshift-flannel; \
54
54
systemctl disable openvswitch; \
@@ -60,6 +60,20 @@ RUN ${REPO_CONFIG_SCRIPT} ${USHIFT_RPM_REPO_PATH} && \
60
60
61
61
RUN ${OKD_CONFIG_SCRIPT} && rm -rf ${OKD_CONFIG_SCRIPT}
62
62
63
+ # If the EMBED_CONTAINER_IMAGES environment variable is set to 1:
64
+ # 1. Temporarily configure user namespace UID and GID mappings by writing to /etc/subuid and /etc/subgid and clean it later
65
+ # - This allows the skopeo command to operate properly which requires user namespace support.
66
+ # - Without it following error occur during image build
67
+ # - FATA[0129] copying system image from manifest list:[...]unpacking failed (error: exit status 1; output: potentially insufficient UIDs or GIDs available[...]
68
+ # 2. Extract the list of image URLs from a JSON file (`release-$(uname -m).json`) while excluding the "lvms_operator" image.
69
+ # - `lvms_operator` image is excluded because it is not available upstream
70
+ RUN if [ "$EMBED_CONTAINER_IMAGES" -eq 1 ]; then \
71
+ echo "root:100000:65536" > /etc/subuid; \
72
+ echo "root:100000:65536" > /etc/subgid; \
73
+ jq -r '.images | to_entries | map(select(.key != "lvms_operator")) | .[].value' /usr/share/microshift/release/release-$(uname -m).json | xargs -n 1 -I {} skopeo copy docker://{} containers-storage:{}; \
74
+ rm -f /etc/subuid /etc/subgid; \
75
+ fi
76
+
63
77
# Create a systemd unit to recursively make the root filesystem subtree
64
78
# shared as required by OVN images
65
79
COPY ./packaging/imagemode/systemd/microshift-make-rshared.service /etc/systemd/system/microshift-make-rshared.service
0 commit comments