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?

  • Is it possible to update Docker on CoreOS without updating fleet and etcd?
  • How to join ElasticSearch cluster with nodes in docker instance
  • Access non-IP interface in docker container
  • AWS EC2 - connection refused running docker container
  • Saving files on Mac OSX host to Docker container (auto-reloading)
  • Sending logs from docker container to FluentD
  • Pass AWS credentials (IAM role credentials) to code running in docker container
  • How to configure docker to use /opt instead of /var
  • ECS agent can not successfully pull image from ECR
  • Why does bash script work depend on the size of the terminal window?
  • docker service cassandra publish port failed
  • Pushing a tag to private docker registry in artifactory fails from mac
  • 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.