[RUBY] Dramatically speed up slow bundle install in docker environment

Purpose

I want to speed up bundle install time with newsdict.io (rails on docker environment)

Method

--Put the heaviest gem that doesn't change much in the base docker image so that you can use the gem. --Since I was using nokogiri, I use [--use-system-libraries] --Run bundle install in parallel

Actual code

--Put the heaviest gem that doesn't change much in the base docker image so that you can use the gem.

https://github.com/newsdict/docker_rails/blob/master/Dockerfile#L70

--Docker image used as a base

https://hub.docker.com/repository/docker/newsdict/rails

--Since I was using nokogiri, I use [--use-system-libraries]

https://github.com/yubele/newsdict.io/blob/9747c9a4d0a69f8f251f1deb9d6b776856281a2b/Dockerfile#L25

--Run bundle install in parallel

https://github.com/yubele/newsdict.io/blob/9747c9a4d0a69f8f251f1deb9d6b776856281a2b/Dockerfile#L24

Q&A

Shouldn't the result of bundle install be a docker image?

Because the Gemfile may be rewritten frequently

Recommended Posts

Dramatically speed up slow bundle install in docker environment
Install laravel/Dusk in docker environment (laravel6)
Just install Laravel8 on docker in PHP8 environment
Command memo to install xeyes in ubuntu docker environment
Install yarn in docker image
Install / run a standalone robot simulator in wsl2 / docker environment!
Install by specifying the version of Django in the Docker environment
Install CentOS Stream 8 in Hyper-V environment
Install lsb_release from the command line when lsb_release fails in docker environment
Error summary in bundle install. memorandum
Check MySQL logs in Docker environment
Install Zabbix 5.0 with Docker → Set up Slack notification in case of failure
Alert slack with alert manager in Docker environment
WSL2 + Ubuntu 20.04 Install Vivado in LTS environment
[Docker] Use environment variables in Nginx conf
Use docker in proxy environment on ubuntu 20.04.1
Edit Mysql with commands in Docker environment
Install ruby serial port in WSL environment
Show Better Errors in Rails + Docker environment
Install Docker and create Java runtime environment
Error in bundle install when running rails new
How to install Titan2D (v4.2.0) in virtual environment
Setting up Docker Engine in a non-internet connection
Support out of support in docker environment using centos6
Docker × Laravel HTTPS (SSL) communication in local environment
[Beginner] Install java development tool in cloud9 development environment.
Install Ubuntu 20.04 in virtual box on windows10 and build a development environment using docker