genuinetools / img

Standalone, daemon-less, unprivileged Dockerfile and OCI compatible container image builder.
https://blog.jessfraz.com/post/building-container-images-securely-on-kubernetes/
MIT License
3.88k stars 229 forks source link

Ability to build images offline #165

Open akshaymankar opened 5 years ago

akshaymankar commented 5 years ago

What are we trying to do?

We need to build a container from a Dockerfile in an airgapped (without internet access) environment using img. We would like to use img because we don't want to install the Docker daemon in that environment.

With Docker daemon

FROM nginx:alpine
COPY foo /foo

We can run these commands to build the image without internet access:

docker load -i nginx-alpine.tgz
docker build .

With img

There seems to be no way for us to do this using img. We have tried using img pull and turning off the internet, but it still tries to go to the docker registry (maybe to check metadata). It would be really great if there was a way to load an image and turn off the metadata check while building.

Is our understanding correct? If not please let us know. Does this sound like a valid feature for img?

/cc @sahilm

AkihiroSuda commented 5 years ago

cc @tonistiigi

tonistiigi commented 5 years ago

@AkihiroSuda Lets open this issue in upstream and discuss the technical solutions. Definitely a must-have feature.

akshaymankar commented 5 years ago

Hi @tonistiigi @AkihiroSuda, Thanks for confirming the issue. I don't see any issues in buildkit open yet, can you please link us when you open it. Also, we are open to contribute code for this, let us know if it is possible.

AkihiroSuda commented 5 years ago

opened issue https://github.com/moby/buildkit/issues/706

PR is welcome ^^