1. Create the scripts

Let’s create the scripts on the directory scripts1/

mkdir scripts1
echo 'include(jammy)' > scripts1/Dockerfile
echo 'APP=scripts1'   > scripts1/settings.sh

It should look like this:

/var/test # tree
.
└── scripts1
    ├── Dockerfile
    └── settings.sh

The Dockerfile defines the image of the container. It is like a normal Dockerfile, except that before being used to build the image, it is preprocessed by m4 in order to include other files, etc. The file jammy is provided by docker-scripts and has a content like this:

FROM ubuntu:22.04

### install systemd
RUN apt update && \
    apt upgrade --yes && \
    apt install --yes systemd && \
    systemctl set-default multi-user.target

STOPSIGNAL SIGRTMIN+3

CMD ["/lib/systemd/systemd"]
WORKDIR /host

RUN apt install --yes \
        locales rsyslog logrotate cron logwatch ssmtp vim

There are more dockerfiles provided by docker-scripts, like: bionic, buster, bullseye, etc. Almost all of them start from an ubuntu or debian base image, install systemd, and make it the process/command that is started inside the container. Then systemd will take care of running any other services that might be installed inside the container, like cron, apache2, etc. This way the container can be used like a virtual machine.