Skip to content

Commit

Permalink
Generate a random product_uuid at containerd
Browse files Browse the repository at this point in the history
Signed-off-by: Quique Llorente <ellorent@redhat.com>
  • Loading branch information
qinqon committed Jun 22, 2021
1 parent 2a1e9df commit b31b384
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions images/base/Dockerfile
Expand Up @@ -112,6 +112,7 @@ RUN echo "Installing Packages ..." \
libseccomp2 pigz \
bash ca-certificates curl rsync \
nfs-common fuse-overlayfs \
jq \
&& find /lib/systemd/system/sysinit.target.wants/ -name "systemd-tmpfiles-setup.service" -delete \
&& rm -f /lib/systemd/system/multi-user.target.wants/* \
&& rm -f /etc/systemd/system/*.wants/* \
Expand Down Expand Up @@ -142,8 +143,10 @@ RUN echo "Installing containerd ..." \
&& sha256sum --ignore-missing -c /tmp/runc.sha256 \
&& mv /tmp/runc.${TARGETARCH} /usr/local/sbin/runc \
&& chmod 755 /usr/local/sbin/runc \
&& ctr oci spec |jq '.mounts[.mounts | length] |= . + {"destination": "/sys/class/dmi/id/product_uuid", "source": "/sys/class/dmi/id/product_uuid", "options": ["ro", "bind"]}'> /etc/containerd/cri-base.json \
&& containerd --version \
&& runc --version \
&& apt-get remove jq \
&& systemctl enable containerd

RUN echo "Installing crictl ..." \
Expand Down
2 changes: 2 additions & 0 deletions images/base/files/etc/containerd/config.toml
Expand Up @@ -17,6 +17,8 @@ version = 2
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
# set default runtime handler to v2, which has a per-pod shim
runtime_type = "io.containerd.runc.v2"
# Generated by "ctr oci spec" and modified at base container to mount poduct_uuid
base_runtime_spec = "/etc/containerd/cri-base.json"

# Setup a runtime with the magic name ("test-handler") used for Kubernetes
# runtime class tests ...
Expand Down

0 comments on commit b31b384

Please sign in to comment.