How do I build docker images without docker?

Is there some lightweight way I can build a docker image within a container without having a working docker machine. Here’s what I’m trying to do:

$ docker run -it --rm docker:latest

/ # mkdir test
/ # touch test/Dockerfile
/ # docker build test
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Assuming I had a valid Dockerfile in place, is there some way I could create an docker image from within a container like this?

  • Best practices for certificates in docker
  • Permission Issue in Docker container for Symfony2
  • Is there a way to backup my docker environment
  • Running nodeJS app, selenium and webdriver.io tests in docker container
  • How can I run my docker container with installed Nginx?
  • How to make postgresql database connectable from outside of the postgres docker container?
  • collectd data not showing in influxdb container
  • Dockerhub fails to build my Dockerfile
  • How can I tell if I'm logged in to a private Docker registry from a script?
  • I want to share code content across several containers using docker-compose volume directive
  • Redis+Docker+Django - Error 111 Connection Refused
  • Execute bash command if docker container does not exist
  • One Solution collect form web for “How do I build docker images without docker?”

    Part of the problem could be that you’re missing the --privileged flag, but in general, your questions can probably be answered here: https://hub.docker.com/_/docker/

    And you might take the time to read the blog linked there detailing some of the pitfalls of using docker-in-docker.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.