Skip to content

Commit

Permalink
image size reduction [ship:docker] (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
GbArc authored Oct 5, 2022
1 parent 5cc249d commit 0046d20
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
44 changes: 22 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DOCKER ?= docker

.PHONY: docker-build
docker-build:
$(DOCKER) build --build-arg bundle_gems__contribsys__com=$(BUNDLE_GEMS__CONTRIBSYS__COM) -t $(DOCKER_DEST) .
$(DOCKER) build --pull --no-cache --build-arg bundle_gems__contribsys__com=$(BUNDLE_GEMS__CONTRIBSYS__COM) -t $(DOCKER_DEST) .

.PHONY: docker-login
docker-login:
Expand Down

0 comments on commit 0046d20

Please sign in to comment.