I understand that COPY can copy files from source folder to destination, but what is purpose of COPY . .?
For example:
FROM ruby:2.5.1
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
RUN bundle install
COPY . .
CMD ["./your-daemon-or-script.rb"]
That will copy the current working directory of your local machine into the current working directory of the container.
See the WORKDIR
This command will copy all the content of the parent directory in which your dockerfile resides(contents of your machine) to the location of the WORKDIR in your container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With