Dockerfile又一發現

重大發現,好啦其實也沒這麼誇張。

當我們在建置Dockerfile時,常常會使用ADD這個命令來將我們host的檔案加入欲建制的container之中。
ADD的指令如下:

ADD <src>... <dest>

我們可以同時增加多個<src>,到container中的<dest>路徑下。詳細請見Docker Document

Document當中又說到<src>須為relative path to the source directory。

除此之外

在設定<src>時,我們還要注意要src path必須要包含在我們build當下的目錄之中:

The <src> path must be inside the context of the build;   
you cannot ADD ../something/something, 
because the first step of a docker build is to send the context directory 
(and subdirectories) to the docker daemon.