github.com/pluralsh/plural-cli@v0.9.5/dockerfiles/Dockerfile.dind (about)

     1  FROM ubuntu:jammy
     2  
     3  #
     4  # Systemd installation
     5  #
     6  RUN apt-get update &&                            \
     7      apt-get install -y --no-install-recommends   \
     8              systemd                              \
     9              systemd-sysv                         \
    10              libsystemd0                          \
    11              ca-certificates                      \
    12              dbus                                 \
    13              iptables                             \
    14              iproute2                             \
    15              kmod                                 \
    16              locales                              \
    17              sudo                                 \
    18              udev &&                              \
    19                                                   \
    20      # Prevents journald from reading kernel messages from /dev/kmsg
    21      echo "ReadKMsg=no" >> /etc/systemd/journald.conf &&               \
    22                                                                        \
    23      # Housekeeping
    24      apt-get clean -y &&                                               \
    25      rm -rf                                                            \
    26         /var/cache/debconf/*                                           \
    27         /var/lib/apt/lists/*                                           \
    28         /var/log/*                                                     \
    29         /tmp/*                                                         \
    30         /var/tmp/*                                                     \
    31         /usr/share/doc/*                                               \
    32         /usr/share/man/*                                               \
    33         /usr/share/local/*                                          
    34  
    35  # Disable systemd services/units that are unnecessary within a container.
    36  RUN systemctl mask systemd-udevd.service \
    37                     systemd-udevd-kernel.socket \
    38                     systemd-udevd-control.socket \
    39                     systemd-modules-load.service \
    40                     sys-kernel-debug.mount \
    41                     sys-kernel-tracing.mount
    42  
    43  # Make use of stopsignal (instead of sigterm) to stop systemd containers.
    44  STOPSIGNAL SIGRTMIN+3
    45  
    46  
    47  # Install Docker
    48  RUN apt-get update && apt-get install -y curl \
    49      && rm -rf /var/lib/apt/lists/* \
    50      && curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh \
    51  ADD https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker /etc/bash_completion.d/docker.sh
    52  
    53  COPY dockerfiles/dind-config/docker.service /lib/systemd/system/docker.service
    54  COPY dockerfiles/dind-config/daemon.json /etc/docker/daemon.json
    55  
    56  
    57  # Set systemd as entrypoint.
    58  ENTRYPOINT [ "/sbin/init", "--log-level=err" ]