Prasad Bhokare
Prasad Bhokare

Reputation: 439

How to specify docker image path on command line without editing configuration setting?

I have my docker container images in different directories. And I would like to specify the path of the directory in the docker -run command. There is a method to change this path by editing the '-g' option in the configuration file, but it requires to restart the docker deamon. Is there any way to specify the docker image path in the docker-run command itself?

Upvotes: 1

Views: 1079

Answers (1)

Phani
Phani

Reputation: 1901

Docker must have the knowledge of not just your image physical location, but its complete tree. because docker image is made up of layers, where each layer is built with one Dockerfile command.

Hence, you should let docker register / know all the images from the directory where the images are present. Moreover, if you have physically copied these images from another machine, they would not work unless they are registered / tagged within Docker engine.

The short answer to your question is NO, it is not possible.

Docker engine itself should manage the images, you could do all what docker engine is doing by changing all the configuration files it maintains internally, because all of them are plain text. But it is definitely not worth your time, and you are better off with docker managing the images itself.

Upvotes: 1

Related Questions