-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
image size reduction [ship:docker] (#260)
- Loading branch information
Showing
2 changed files
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,36 +2,36 @@ FROM ruby:2.5.9-slim | |
|
||
LABEL maintainer Travis CI GmbH <[email protected]> | ||
|
||
# packages required for bundle install | ||
RUN ( \ | ||
apt-get update ; \ | ||
# update to deb 10.8 | ||
apt-get upgrade -y ; \ | ||
apt-get install -y --no-install-recommends git make gcc g++ libpq-dev curl \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
) | ||
|
||
RUN ( \ | ||
curl -sLO http://ppa.launchpad.net/rmescandon/yq/ubuntu/pool/main/y/yq/yq_3.1-2_amd64.deb && \ | ||
dpkg -i yq_3.1-2_amd64.deb && \ | ||
rm -f yq_3.1-2_amd64.deb; \ | ||
bundle config set no-cache 'true'; \ | ||
bundle config --global frozen 1; \ | ||
bundle config set deployment 'true'; \ | ||
mkdir -p /app; \ | ||
) | ||
|
||
RUN gem install bundler -v '2.3.7' | ||
|
||
# throw errors if Gemfile has been modified since Gemfile.lock | ||
RUN bundle config --global frozen 1 | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
|
||
COPY Gemfile /app | ||
COPY Gemfile.lock /app | ||
|
||
ARG bundle_gems__contribsys__com | ||
RUN bundle config https://gems.contribsys.com/ $bundle_gems__contribsys__com \ | ||
|
||
RUN ( \ | ||
apt-get update ; \ | ||
apt-get upgrade -y ; \ | ||
apt-get install -y git make gcc g++ libpq-dev curl \ | ||
&& rm -rf /var/lib/apt/lists/*; \ | ||
curl -sLO http://ppa.launchpad.net/rmescandon/yq/ubuntu/pool/main/y/yq/yq_3.1-2_amd64.deb && \ | ||
dpkg -i yq_3.1-2_amd64.deb && \ | ||
rm -f yq_3.1-2_amd64.deb; \ | ||
gem install bundler -v '2.3.14'; \ | ||
bundle config https://gems.contribsys.com/ $bundle_gems__contribsys__com \ | ||
&& bundle install --deployment \ | ||
&& bundle config --delete https://gems.contribsys.com/ | ||
RUN gem install --user-install executable-hooks | ||
&& bundle config --delete https://gems.contribsys.com/; \ | ||
apt-get remove -y gcc g++ make git perl && apt-get -y autoremove; \ | ||
bundle clean && rm -rf /app/vendor/bundle/ruby/2.5.0/cache/*; \ | ||
rm -rf /usr/local/bundle/cache/\*.gem; \ | ||
find /usr/local/bundle/gems/ \( -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.o' \) -delete; \ | ||
find /app/vendor/ \( -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.o' \) -delete; \ | ||
) | ||
|
||
COPY . /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters