Running Docker on Ubuntu docker image
NickName:Fela Maslen Ask DateTime:2018-04-12T22:45:33

Running Docker on Ubuntu docker image

I'm having trouble getting Docker CE to run on an Ubuntu Docker image. Here's my Dockerfile:

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y curl apt-transport-https ca-certificates curl gnupg2 software-properties-common
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt-get update && apt-get install -y docker-ce

RUN docker info

The last command fails with the following:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

If I attempt to run dockerd from the container, it comes back with the following:

ERRO[2018-04-12T14:35:43.945962200Z] 'overlay2' is not supported over overlayfs
INFO[2018-04-12T14:35:43.974187900Z] Graph migration to content-addressability took 0.00 seconds
INFO[2018-04-12T14:35:43.976355700Z] Loading containers: start.
WARN[2018-04-12T14:35:43.978060300Z] Running modprobe bridge br_netfilter failed with message: , error: exec: "modprobe": executable file not found in $PATH
WARN[2018-04-12T14:35:43.978173000Z] Running modprobe nf_nat failed with message: ``, error: exec: "modprobe": executable file not found in $PATH
WARN[2018-04-12T14:35:43.978965200Z] Running modprobe xt_conntrack failed with message: ``, error: exec: "modprobe": executable file not found in $PATH
Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain: iptables failed: iptables -t nat -N DOCKER: iptables v1.6.0: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
 (exit status 3)

I assume there is something missing in the kernel for the ubuntu image?

Here's the output of uname -a, from the container:

root@85bdefe67e4a:/# uname -a
Linux 85bdefe67e4a 4.9.87-linuxkit-aufs #1 SMP Wed Mar 14 15:12:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Is it something wrong with the ubuntu:16.04 container or is there something I'm forgetting?

Copyright Notice:Content Author:「Fela Maslen」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/49799563/running-docker-on-ubuntu-docker-image

More about “Running Docker on Ubuntu docker image” related questions

Running Docker on Ubuntu docker image

I'm having trouble getting Docker CE to run on an Ubuntu Docker image. Here's my Dockerfile: FROM ubuntu:16.04 RUN apt-get update && apt-get install -y curl apt-transport-https ca-certifi...

Show Detail

Running a docker container of a ubuntu image

New to docker. I'm trying to run a ubuntu image container. after executing docker run ubuntu I don't find the container with docker ps. I tried docker ps -aand I found the status of the container &...

Show Detail

Docker inside ubuntu 18.04 docker image not running

I have installed a ubuntu 18.04 container inside which I tried to start the docker service. I got the error, Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon

Show Detail

Ubuntu docker image is not running in the detached mode

I created one image using below Dockerfile FROM ubuntu:latest RUN mkdir -p /app COPY . /app CMD python /app/app.py I am using this command to build the image: DOCKER_BUILDKIT=1 docker

Show Detail

Running ubuntu docker image in background

I was trying to run ubuntu docker image in background. So I tried below command sudo docker container run -d --name my-ubuntu-container ubuntu:latest But this command do not run the container in

Show Detail

Ubuntu docker running docker

I have the following docker-compose file: version: '2' services: ubuntu: image: 'ubuntu:16.04' ports: - '22:22' When start this, the container seems to crash, the followin

Show Detail

Docker ubuntu image is not working

I am trying to create a docker container from docker image but it is not starting and I don't see error. First I tried this Docker file: FROM php:7.0-apache MAINTAINER Tony Lea <tony.lea@

Show Detail

docker service shows an image running but not listed in docker container

I created a service such like $ docker service create --name psql --secret psql_user --secret psql_pass -e POSTGRES_PASSWORD_FILE=/run/secrets/psql_pass -e POSTGRES_USER_FILE=/run/secrets/psql_user

Show Detail

Docker on ubuntu app for windows 10 starting but not running

I have a windows 10 enterprise laptop. Installing docker on that machine in the past proved unsuccessful. As an alternative I have installed the ubuntu app from microsoft store, ubuntu version Ubu...

Show Detail

Docker ubuntu image with web server installed explicitly vs docker web server image?

What is the difference between Docker os image with web server installed with a web server and Docker webserver image ? For eg Docker image of Ubuntu-16.04 running as container with NginX installed...

Show Detail