I have an existing custom service at /lib/systemd/system/custom.service
with:
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
User=customuser
ExecStart=/opt/customservice /opt/custom.config
[Install]
WantedBy=multi-user.target
With:
systemctl enable custom.service
systemctl start custom.service
How can I convert this service to a docker container, keeping in in foreground and always up and running?
I started with a Dockerfile
as follows:
FROM ubuntu:20
COPY /custom.service /opt/app/
COPY /custom.config /opt/app/
ENTRYPOINT [ "/opt/custom.service", "/opt/custom.config" ]
But how can I now achieve the same configuration as I had in the native systemd
service?