Search code examples
buildcopycontainersibm-clouddockerfile

Can I use COPY to add in files when building images on Bluemix?


I'd like to build my images on Bluemix and not locally. Can I use COPY to include my own files into the image ? If so where can I store the files ?

Or maybe if I had the files on github I could pull them from github ?


Solution

  • Yes, you can!

    When you run cf ic build or docker build, the contents of your current directory (your "build context") are sent along with the build request. You can use the COPY or ADD instructions to add any file or folder within the build context into your container image, just as you can locally.

    If you want to use an online source such as Github anyway, you can ADD the file from a URL. For more information, see the Dockerfile reference.