What is the default location for included files when creating docker image?

derrend@laptop ~/topdir $ docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

derrend@laptop ~/topdir $ pwd; ls *
$HOME/topdir
Dockerfile

afolder:
afile

As I understand it, when I execute docker build afolder, and its contents will be included in my image dockers, but where will they be placed if I do not assign a location to Dockerfile?

+1
source share
1 answer

These files are not part of the embedded (final) image.

They are part of the build context passed to the daemons during the build process , which will be used by Dockerfile directives, such as ADDor COPYor RUN.

, PATH URL

, , , docker, :

$ docker build https://github.com/docker/rootfs.git#container:docker

Context ModifiableContext.

+1

Source: https://habr.com/ru/post/1661320/


All Articles