I am trying to add systemd on our image and I am using this example from github, but the service isnt starting after it was downloaded. I’m not sure how to go about solving this as I am fairly inexperienced.
here is my docker.template
FROM balenalib/%%BALENA_MACHINE_NAME%%-node:12.14.0-buster-build
#################
# Install Systemd
#################
ENV container docker
RUN apt-get update && apt-get install -y --no-install-recommends \
systemd \
systemd-sysv \
&& rm -rf /var/lib/apt/lists/*
# We never want these to run in a container
# Feel free to edit the list but this is the one we used
RUN systemctl mask \
dev-hugepages.mount \
sys-fs-fuse-connections.mount \
sys-kernel-config.mount \
display-manager.service \
getty@.service \
systemd-logind.service \
systemd-remount-fs.service \
getty.target \
graphical.target
COPY resin/entry.sh /usr/bin/entry.sh
COPY resin/balena.service /etc/systemd/system/balena.service
RUN systemctl enable /etc/systemd/system/balena.service
STOPSIGNAL 37
ENTRYPOINT ["/usr/bin/entry.sh"]
######################
# Finish setup systemd
######################
# Defines our working directory in container
WORKDIR /usr/src/app
# This will copy all files in our root to the working directory in the container
COPY . ./
# Set the timezone
RUN ./resin/timezone.sh
ENV UDEV=1
# use apt-get if you need to install dependencies,
RUN apt-get update && apt-get install -yq \
libudev-dev libusb-1.0-0-dev vim python libpython2.7 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PlatformIO
RUN python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/develop/scripts/get-platformio.py)"
# Install Gulp
RUN npm install -g gulp
CMD ["bash", "./resin/start.sh"]