Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 798
Matthew Avatar asked Jul 18 '16 11:07

Matthew


1 Answers

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.

like image 146
Bryan Burke Avatar answered Nov 16 '22 02:11

Bryan Burke