1 DL3028
José Lorenzo Rodríguez edited this page 2019-06-21 09:16:36 +02:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Pin versions in gem install

Problematic code:

FROM ruby:2
RUN gem install bundler

Correct code:

FROM ruby:2
RUN gem install bundler:1.1

Rationale:

https://docs.docker.com/engine/articles/dockerfile_best-practices/

Version pinning forces the build to retrieve a particular version regardless of whats in the cache. This technique can also reduce failures due to unanticipated changes in required packages.