3

I have a Ubuntu18.04 server and want to run docker in it to launch containers. Because I have Windows locally, I planned to use Docker to launch the Ubuntu18.04 server itself. But there seems to be some problem with runlevels on Windows:

invoke-rc.d: could not determine current runlevel

This problem is already known, but without any answer yet. I tried the following Dockerfile:

FROM    ubuntu:18.04

ARG WORK_DIR="myapp"

WORKDIR ${WORK_DIR}

# some basic programs
RUN     apt update && apt install -y \
        zsh \
        wget \
        curl \
        git-core \
        vim \
        emacs

#install docker
# https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/errors-in-ubuntu-1804-on-windows-10/fe349f3d-3d58-4d90-9f8f-c14d7c12af8b
RUN cp -p  /bin/true /sbin/ebtables \
&& apt update -y \
&& apt upgrade -y \
apt update \
&& apt install -y apt-transport-https ca-certificates curl software-properties-common \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" \
&& apt update \
&& apt-cache policy docker-ce \
&& echo exit 0 > /usr/sbin/policy-rc.d \
&& export RUNLEVEL=1 && apt install -y docker-ce

RUN docker run hello-world

The apt install -y docker-ce raises the error.

Maximilian Mordig
  • 1,333
  • 1
  • 12
  • 16

0 Answers0