]> git.proxmox.com Git - ceph.git/blame - ceph/src/cephadm/box/DockerfilePodman
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / cephadm / box / DockerfilePodman
CommitLineData
1e59de90
TL
1# stable/Dockerfile
2#
3# Build a Podman container image from the latest
4# stable version of Podman on the Fedoras Updates System.
5# https://bodhi.fedoraproject.org/updates/?search=podman
6# This image can be used to create a secured container
7# that runs safely with privileges within the container.
8#
9FROM fedora:34
10
11ENV CEPHADM_PATH=/usr/local/sbin/cephadm
12RUN ln -s /ceph/src/cephadm/cephadm.py $CEPHADM_PATH # NOTE: assume path of ceph volume
13
14# Don't include container-selinux and remove
15# directories used by yum that are just taking
16# up space.
17RUN dnf -y update; rpm --restore shadow-utils 2>/dev/null; \
18yum -y install podman fuse-overlayfs --exclude container-selinux; \
19rm -rf /var/cache /var/log/dnf* /var/log/yum.*
20
21RUN dnf install which firewalld chrony procps systemd openssh openssh-server openssh-clients sshpass lvm2 -y
22
23ADD https://raw.githubusercontent.com/containers/podman/main/contrib/podmanimage/stable/containers.conf /etc/containers/containers.conf
24ADD https://raw.githubusercontent.com/containers/podman/main/contrib/podmanimage/stable/podman-containers.conf /root/.config/containers/containers.conf
25
26RUN mkdir -p /root/.local/share/containers; # chown podman:podman -R /home/podman
27
28# Note VOLUME options must always happen after the chown call above
29# RUN commands can not modify existing volumes
30VOLUME /var/lib/containers
31VOLUME /root/.local/share/containers
32
33# chmod containers.conf and adjust storage.conf to enable Fuse storage.
34RUN chmod 644 /etc/containers/containers.conf; 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
35RUN 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
36
37RUN echo 'root:root' | chpasswd
38
39RUN dnf install -y adjtimex # adjtimex syscall doesn't exist in fedora 35+ therefore we have to install it manually
40 # so chronyd works
41RUN dnf install -y strace sysstat # debugging tools
42RUN dnf -y install hostname iproute udev
43ENV _CONTAINERS_USERNS_CONFIGURED=""
44
45RUN useradd podman; \
46echo podman:0:5000 > /etc/subuid; \
47echo podman:0:5000 > /etc/subgid; \
48echo root:0:65535 > /etc/subuid; \
49echo root:0:65535 > /etc/subgid;
50
51VOLUME /home/podman/.local/share/containers
52
53ADD https://raw.githubusercontent.com/containers/libpod/master/contrib/podmanimage/stable/containers.conf /etc/containers/containers.conf
54ADD https://raw.githubusercontent.com/containers/libpod/master/contrib/podmanimage/stable/podman-containers.conf /home/podman/.config/containers/containers.conf
55
56RUN chown podman:podman -R /home/podman
57
58RUN echo 'podman:podman' | chpasswd
59RUN touch /.box_container # empty file to check if inside a container
60
61EXPOSE 8443
62EXPOSE 22
63
64ENTRYPOINT ["/usr/sbin/init"]