60 lines
2.1 KiB
Django/Jinja
60 lines
2.1 KiB
Django/Jinja
# Molecule managed
|
|
# Copyright 2020 Red Hat, Inc.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
|
|
{% if item.registry is defined %}
|
|
FROM {{ item.registry.url }}/{{ item.image }}
|
|
{% else %}
|
|
FROM {{ item.image }}
|
|
{% endif %}
|
|
|
|
RUN dnf makecache && dnf --assumeyes install sudo python*-devel python*-dnf bash python*setuptools systemd {{ item.pkg_extras | default('') }} && dnf clean all;
|
|
|
|
RUN dnf -y update && \
|
|
rpm --setcaps shadow-utils 2>/dev/null && \
|
|
dnf -y install podman fuse-overlayfs \
|
|
--exclude container-selinux && \
|
|
dnf clean all && \
|
|
rm -rf /var/cache /var/log/dnf* /var/log/yum.*
|
|
|
|
{% for pkg in item.easy_install | default([]) %}
|
|
# install pip for centos where there is no python-pip rpm in default repos
|
|
RUN easy_install {{ pkg }}
|
|
{% endfor %}
|
|
|
|
ARG _REPO_URL="https://raw.githubusercontent.com/containers/podman/main/contrib/podmanimage/stable"
|
|
ADD $_REPO_URL/containers.conf /etc/containers/containers.conf
|
|
|
|
RUN sed -i -e 's|^#mount_program|mount_program|g' \
|
|
-e '/additionalimage.*/a "/var/lib/shared",' \
|
|
-e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \
|
|
/etc/containers/storage.conf
|
|
|
|
VOLUME /var/lib/containers
|
|
|
|
RUN mkdir -p /var/lib/shared/overlay-images \
|
|
/var/lib/shared/overlay-layers \
|
|
/var/lib/shared/vfs-images \
|
|
/var/lib/shared/vfs-layers && \
|
|
touch /var/lib/shared/overlay-images/images.lock && \
|
|
touch /var/lib/shared/overlay-layers/layers.lock && \
|
|
touch /var/lib/shared/vfs-images/images.lock && \
|
|
touch /var/lib/shared/vfs-layers/layers.lock
|
|
|
|
ENV _CONTAINERS_USERNS_CONFIGURED=""
|
|
|
|
CMD {{ item.command }}
|