diff --git a/base/ubi9/Dockerfile b/base/ubi9/Dockerfile index 4da4e9bc..7b25150b 100644 --- a/base/ubi9/Dockerfile +++ b/base/ubi9/Dockerfile @@ -117,11 +117,6 @@ RUN mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers; \ touch /var/lib/shared/overlay-images/images.lock; \ touch /var/lib/shared/overlay-layers/layers.lock -# But use VFS since not all environments support overlay with Fuse backend -RUN mkdir -p "${HOME}"/.config/containers && \ - (echo '[storage]';echo 'driver = "vfs"') > "${HOME}"/.config/containers/storage.conf && \ - chown -R 10001 "${HOME}"/.config - # Add kubedock ENV KUBEDOCK_VERSION 0.17.0 ENV KUBECONFIG=/home/user/.kube/config diff --git a/base/ubi9/entrypoint.sh b/base/ubi9/entrypoint.sh index aec8312f..0754ce5a 100644 --- a/base/ubi9/entrypoint.sh +++ b/base/ubi9/entrypoint.sh @@ -5,6 +5,16 @@ if [ ! -d "${HOME}" ]; then mkdir -p "${HOME}" fi +# Configure container builds to use vfs or fuse-overlayfs +if [ ! -d "${HOME}/.config/containers" ]; then + mkdir -p ${HOME}/.config/containers + if [ -c "/dev/fuse" ] && [ -f "/usr/bin/fuse-overlayfs" ]; then + (echo '[storage]';echo 'driver = "overlay"';echo '[storage.options.overlay]';echo 'mount_program = "/usr/bin/fuse-overlayfs"') > ${HOME}/.config/containers/storage.conf + else + (echo '[storage]';echo 'driver = "vfs"') > "${HOME}"/.config/containers/storage.conf + fi +fi + # Setup $PS1 for a consistent and reasonable prompt if [ -w "${HOME}" ] && [ ! -f "${HOME}"/.bashrc ]; then echo "PS1='[\u@\h \W]\$ '" > "${HOME}"/.bashrc