我正在使用 docker 官方 rails onbuild pack ( https://registry.hub.docker.com/_/rails/ ) 使用应用程序构建和创建 rails 映像。但是每个应用程序占用大约 900MB。有什么办法可以减小这个尺寸?
这是我的工作流程->
add dockerfile to the project -> build -> run
问题是这个系统上可能有 N 个应用程序,如果每个应用程序占用 1G 的磁盘空间,这将是一个问题。如果我们减少层数,它会减小尺寸吗?如果是的话怎么做?
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
blog2 latest 9d37aaaa3beb About a minute ago 931.1 MB
my-rails-app latest 9904zzzzc2af About an hour ago 931.1 MB