version: '3.7'
#
# Setup to run docker containers in such a way that systemd is satisfied,
# allowing us to test our install script properly.
#
# Newer versions of docker (after 20.10) which support cgroup v2 no longer need
# the /sys/fs/cgroup volume mapping as that will be handled automatically. In
# fact, having the mapping causes errors when starting the containers. As such
# the containers defined below no longer map that volume. This means that they
# _must_ be run on a host that is using version 20.10 or higher.
#
services:
  centos_8_install_test:
    build:
      context: ../..
      dockerfile: test/install/CentOS8.dockerfile
    image: has-centos8-install-test
    container_name: centos_8_install_test
    privileged: true
    cap_add:
      - SYS_ADMIN
    security_opt:
      - seccomp:unconfined
    stop_signal: SIGRTMIN+3
    tmpfs:
      - /run
      - /run/lock
      - /tmp

  centos_8_scim_test:
    build:
      context: ../..
      dockerfile: test/install/CentOS8-scim.dockerfile
    image: has-centos8-scim-test
    container_name: centos_8_scim_test
    privileged: true
    cap_add:
      - SYS_ADMIN
    security_opt:
      - seccomp:unconfined
    stop_signal: SIGRTMIN+3
    tmpfs:
      - /run
      - /run/lock
      - /tmp

  rocky_9_install_test:
    build:
      context: ../..
      dockerfile: test/install/Rocky9.dockerfile
    image: has-rocky9-install-test
    container_name: rocky_9_install_test
    privileged: true
    cap_add:
      - SYS_ADMIN
    security_opt:
      - seccomp:unconfined
    stop_signal: SIGRTMIN+3
    tmpfs:
      - /run
      - /run/lock
      - /tmp

  ubuntu_20_install_test:
    build:
      context: ../..
      dockerfile: test/install/Ubuntu20.dockerfile
    image: has-ubuntu20-install-test
    container_name: ubuntu_20_install_test
    privileged: true
    cap_add:
      - SYS_ADMIN
    security_opt:
      - seccomp:unconfined
    stop_signal: SIGRTMIN+3
    tmpfs:
      - /run
      - /run/lock
      - /tmp

  ubuntu_20_scim_test:
    build:
      context: ../..
      dockerfile: test/install/Ubuntu20-scim.dockerfile
    image: has-ubuntu20-scim-test
    container_name: ubuntu_20_scim_test
    privileged: true
    cap_add:
      - SYS_ADMIN
    security_opt:
      - seccomp:unconfined
    stop_signal: SIGRTMIN+3
    tmpfs:
      - /run
      - /run/lock
      - /tmp

  ubuntu_22_install_test:
    build:
      context: ../..
      dockerfile: test/install/Ubuntu22.dockerfile
    image: has-ubuntu22-install-test
    container_name: ubuntu_22_install_test
    privileged: true
    cap_add:
      - SYS_ADMIN
    security_opt:
      - seccomp:unconfined
    stop_signal: SIGRTMIN+3
    tmpfs:
      - /run
      - /run/lock
      - /tmp

  ubuntu_24_install_test:
    build:
      context: ../..
      dockerfile: test/install/Ubuntu24.dockerfile
    image: has-ubuntu24-install-test
    container_name: ubuntu_24_install_test
    privileged: true
    cap_add:
      - SYS_ADMIN
    security_opt:
      - seccomp:unconfined
    stop_signal: SIGRTMIN+3
    tmpfs:
      - /run
      - /run/lock
      - /tmp
