Tuesday, June 27, 2017

Dockerfile Directives


The Directives used inside the Dockerfile

COPY  <src>   <dest> 

The  COPY instruction will copy new files from <src>  and add them  to the container's filesystem at path  <dest> .


ADD  <src>  <dest>

The ADD instruction will copy new files from <src> and add them to the container's filesystem at  path  <dest>  .


Features of ADD:

ADD allows <src>  to be an URL.
if the <src>  parameter of ADD  is an archive in a recognized  compression format, it will be unpacked.
[best use for ADD is local tar file auto-extraction in to the image]

Example:

ADD resources/jdk-7u79-linux-x64.tar.gz   /usr/local/


No comments:

Post a Comment