Hello,
I have a need to start the docker service in the container. Unfortunately I can not run the docker service when the container starts.
Tell me, what am I doing wrong? In my dockerfile I wrote.
FROM jenkins/jenkins:lts
USER root
RUN apt-get update \
&& apt-get install -y sudo \
&& apt-get -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common nano wget vim \
&& curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get -y install docker-ce \
&& rm -rf /var/lib/apt/lists/*
CMD service docker start
#or
ENTRYPOINT service docker start
The container simply does not start. I start it later manually.
Why CMD or ENTRYPOINT does not work?