How to solve "invoke-rc.d: policy-rc.d denied execution of start." when building a container Ubuntu 14.04 and installing apache2?

Viewed 28228

I am trying to install apache2 after a building image process. This is the code I am using in the Dockerfile.

FROM ubuntu:14.04
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

ENV DEBIAN_FRONTEND noninteractive

RUN sudo apt-get update
RUN sudo apt-get install -y apache2

After the process I get the apache installed but I get the follow error (red display in terminal)

...
invoke-rc.d: policy-rc.d denied execution of start.
...

How to solve that issue? If it is an issue.

2 Answers

worked for me after adding in Dockerfile:

RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d

invoke-rc.d: could not determine current runlevel

  • Starting NTP server ntpd ...done.
Related