O'Reilly logo

Docker and Kubernetes for Java Developers by Jaroslaw Krochmalski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ADD

What ADD basically does is copy the files from the source into the container's own filesystem at the desired destination. It takes two arguments: the source (<source path or URL>) and a destination (<destination path>):

ADD <source path or URL> <destination path >

The source can have two forms: it can be a path to a file, a directory, or the URL. The path is relative to the directory in which the build process is going to be started (the build context we have mentioned earlier). This means you cannot have, for example "../../config.json" placed as a source path parameter of the ADD instruction.

The source and destination paths can contain wildcards. Those are the same as in a conventional file system: * for any text string, or ? for any ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required