In a Dockerfile I'm trying to set up a PostgreSQL on an Ubuntu installation but these 2 lines gives me an error:
RUN apt-get install -y postgresql
RUN systemctl enable postgresql && systemctl start postgresql
The error is:
RUN systemctl enable postgresql && systemctl start postgresql
---> Running in ffcd9aa8ebaa
Synchronizing state of postgresql.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable postgresql
System has not been booted with systemd as init system (PID 1). Can't operate.
The command '/bin/sh -c systemctl enable postgresql && systemctl start postgresql' returned a non-zero code: 1
I have tried to search Google, bit I haven't been able to find any suggested solutions. I hope someone here could help me out?
Emil Moe
Senior Data Engineer
I realised you can't do this in a container and that these commands should probably just be ignored.