github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/contrib/podmanimage/upstream/Dockerfile (about)

     1  # git/Dockerfile
     2  #
     3  # Build a Podman container image from the latest
     4  # upstream version of Podman on GitHub.
     5  # https://github.com/containers/libpod
     6  # This image can be used to create a secured container
     7  # that runs safely with privileges within the container.
     8  # The containers created by this image also come with a
     9  # Podman development environment in /root/podman.
    10  #
    11  FROM fedora:latest
    12  ENV GOPATH=/root/podman
    13  
    14  # Install the software required to build Podman.
    15  # Then create a directory and clone from the Podman
    16  # GitHub repository, make and install Podman
    17  # to the container.
    18  # Finally remove the podman directory and a few other packages
    19  # that are needed for building but not running Podman
    20  RUN useradd build; yum -y update; yum -y reinstall shadow-utils; yum -y install --exclude container-selinux \
    21       --enablerepo=updates-testing \
    22       btrfs-progs-devel \
    23       containernetworking-cni \
    24       conmon \
    25       device-mapper-devel \
    26       git \
    27       glib2-devel \
    28       glibc-devel \
    29       glibc-static \
    30       go \
    31       golang-github-cpuguy83-md2man \
    32       gpgme-devel \
    33       iptables \
    34       libassuan-devel \
    35       libgpg-error-devel \
    36       libseccomp-devel \
    37       libselinux-devel \
    38       make \
    39       pkgconfig \
    40       runc \
    41       fuse-overlayfs \
    42       fuse3 \
    43       containers-common; \
    44       mkdir /root/podman; \
    45       git clone https://github.com/containers/libpod /root/podman/src/github.com/containers/libpod; \
    46       cd /root/podman/src/github.com/containers/libpod; \
    47       make BUILDTAGS="selinux seccomp"; \
    48       make install PREFIX=/usr; \
    49       cd /root/podman; \
    50       git clone https://github.com/containers/conmon /root/podman/conmon; \
    51       cd conmon; \
    52       make; \
    53       install -D -m 755 bin/conmon /usr/libexec/podman/conmon; \
    54       git clone https://github.com/containernetworking/plugins.git $GOPATH/src/github.com/containernetworking/plugins; \
    55       cd $GOPATH/src/github.com/containernetworking/plugins; \
    56       ./build_linux.sh; \
    57       mkdir -p /usr/libexec/cni; \
    58       \cp -fR bin/* /usr/libexec/cni; \
    59       mkdir -p /etc/cni/net.d; \
    60       curl -qsSL https://raw.githubusercontent.com/containers/libpod/master/cni/87-podman-bridge.conflist | tee /etc/cni/net.d/99-loopback.conf; \
    61       mkdir -p /usr/share/containers; \
    62       cp $GOPATH/src/github.com/containers/libpod/libpod.conf /usr/share/containers; \
    63       # Adjust libpod.conf to write logging to a file
    64       sed -i 's/# events_logger = "journald"/events_logger = "file"/g' /usr/share/containers/libpod.conf; \
    65       rm -rf /root/podman/*; \
    66       yum -y remove git golang go-md2man make; \
    67       yum clean all;
    68  
    69  # Adjust storage.conf to enable Fuse storage.
    70  RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' /etc/containers/storage.conf
    71  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
    72  
    73  # Set up environment variables to note that this is
    74  # not starting with usernamespace and default to
    75  # isolate the filesystem with chroot.
    76  ENV _BUILDAH_STARTED_IN_USERNS="" BUILDAH_ISOLATION=chroot