I have a Yarn problem when I try to deploy a Rails 6.x app. I have not had a problem until now.

Please help me. I used to be able to deploy, but now I can’t.
The front end uses Vue.

Rails 6.1.6
yarn 1.22.17

Here is the error text

% flyctl deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-hidden-pond-1135 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 3.9s (0/1)                                                                                                                               
[+] Building 21.6s (25/25) FINISHED                                                                                                                   
 => CACHED [internal] load remote build context                                                                                                  0.0s
 => CACHED copy /context /                                                                                                                       0.0s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                            1.6s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5       0.0s
 => [internal] load metadata for quay.io/evl.ms/fullstaq-ruby:3.0.4-jemalloc-slim                                                                0.8s
 => [base 1/6] FROM quay.io/evl.ms/fullstaq-ruby:3.0.4-jemalloc-slim@sha256:a969fd121c1b46326d2555814aee7fd099a9bc8fbfa422862152abed611ee4b0     0.0s
 => CACHED [base 2/6] RUN mkdir /app                                                                                                             0.0s
 => CACHED [base 3/6] WORKDIR /app                                                                                                               0.0s
 => CACHED [base 4/6] RUN mkdir -p tmp/pids                                                                                                      0.0s
 => CACHED [base 5/6] RUN curl https://get.volta.sh | bash                                                                                       0.0s
 => CACHED [base 6/6] RUN volta install node@16.13.0 yarn@1.22.17 &&     gem update --system --no-document &&     gem install -N bundler -v 2.3  0.0s
 => CACHED [stage-4 1/8] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt     --mount=type=cache,id=prod-apt-lib,s  0.0s
 => CACHED [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt     --mount=type=cache,id=dev-apt-lib,  0.0s
 => CACHED [gems 1/2] COPY Gemfile* ./                                                                                                           0.0s
 => CACHED [gems 2/2] RUN bundle install && rm -rf vendor/bundle/ruby/*/cache                                                                    0.0s
 => CACHED [stage-4 2/8] COPY --from=gems /app /app                                                                                              0.0s
 => CACHED [stage-4 3/8] COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions                                        0.0s
 => CACHED [stage-4 4/8] COPY --from=gems /usr/local/bundle /usr/local/bundle                                                                    0.0s
 => CACHED [node_modules 1/3] COPY package*json ./                                                                                               0.0s
 => CACHED [node_modules 2/3] COPY yarn.* ./                                                                                                     0.0s
 => CACHED [node_modules 3/3] RUN yarn install                                                                                                   0.0s
 => CACHED [stage-4 5/8] COPY --from=node_modules /app/node_modules /app/node_modules                                                            0.0s
 => CACHED [stage-4 6/8] COPY . .                                                                                                                0.0s
 => CACHED [stage-4 7/8] RUN chmod +x /app/bin/* &&     sed -i 's/ruby.exe\r*/ruby/' /app/bin/* &&     sed -i '/^#!/aDir.chdir File.expand_path  0.0s
 => ERROR [stage-4 8/8] RUN bin/rails fly:build                                                                                                 19.0s
------
 > [stage-4 8/8] RUN bin/rails fly:build:
#25 5.669 yarn install v1.22.17
#25 5.773 [1/4] Resolving packages...
#25 6.224 [2/4] Fetching packages...
#25 16.19 error https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOSPC: no space left on device, mkdir '/usr/local/share/.cache/yarn/v6/npm-fast-glob-3.2.12-7f39ec99c2e6ab030337142da9e0c18f37afae80-integrity/node_modules/fast-glob/out/utils'"
#25 16.19 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
#25 18.44 rails aborted!
#25 18.44 Errno::ENOSPC: No space left on device @ rb_sysopen - /app/tmp/cache/assets/sprockets/v4.0.0/_q/_qeQSelryH_wPycaCqedOQpajvuutl9QRK6BTS-LbsI.cache.16000.1.821406
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/path_utils.rb:358:in `initialize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/path_utils.rb:358:in `open'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/path_utils.rb:358:in `atomic_write'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cache/file_store.rb:112:in `set'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cache.rb:227:in `set'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cache.rb:143:in `set'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:341:in `fetch_asset_from_dependency_cache'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:43:in `load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `block in load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `fetch'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/bundle.rb:32:in `block in call'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/bundle.rb:31:in `call'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/processor_utils.rb:84:in `call_processor'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/processor_utils.rb:65:in `reverse_each'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/processor_utils.rb:65:in `call_processors'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:182:in `load_from_unloaded'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:59:in `block in load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:337:in `fetch_asset_from_dependency_cache'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:43:in `load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `block in load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `fetch'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/base.rb:81:in `find_asset'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/base.rb:88:in `find_all_linked_assets'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/manifest.rb:125:in `each'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/manifest.rb:125:in `to_a'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `block in synchronize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `synchronize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `synchronize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:in `execute'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promise.rb:564:in `block in realize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:352:in `run_task'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:343:in `block (3 levels) in create_worker'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `loop'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `block (2 levels) in create_worker'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `catch'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `block in create_worker'
#25 18.44 Tasks: TOP => fly:build => assets:precompile
#25 18.44 (See full trace by running task with --trace)
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -o pipefail -c ${BUILD_COMMAND}]: exit code: 1

Dockerfile

# syntax = docker/dockerfile:experimental

# Dockerfile used to build a deployable image for a Rails application.
# Adjust as required.
#
# Common adjustments you may need to make over time:
#  * Modify version numbers for Ruby, Bundler, and other products.
#  * Add library packages needed at build time for your gems, node modules.
#  * Add deployment packages needed by your application
#  * Add (often fake) secrets needed to compile your assets

#######################################################################

# Learn more about the chosen Ruby stack, Fullstaq Ruby, here:
#   https://github.com/evilmartians/fullstaq-ruby-docker.
#
# We recommend using the highest patch level for better security and
# performance.

ARG RUBY_VERSION=3.0.4
ARG VARIANT=jemalloc-slim
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base

LABEL fly_launch_runtime="rails"

ARG NODE_VERSION=16.13.0
ARG YARN_VERSION=1.22.17
ARG BUNDLER_VERSION=2.3.6

ARG RAILS_ENV=production
ENV RAILS_ENV=${RAILS_ENV}

ENV RAILS_SERVE_STATIC_FILES true
ENV RAILS_LOG_TO_STDOUT true

ARG BUNDLE_WITHOUT=development:test
ARG BUNDLE_PATH=vendor/bundle
ENV BUNDLE_PATH ${BUNDLE_PATH}
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}

RUN mkdir /app
WORKDIR /app
RUN mkdir -p tmp/pids

RUN curl https://get.volta.sh | bash
ENV VOLTA_HOME /root/.volta
ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH
RUN volta install node@${NODE_VERSION} yarn@${YARN_VERSION} && \
    gem update --system --no-document && \
    gem install -N bundler -v ${BUNDLER_VERSION}

#######################################################################

# install packages only needed at build time

FROM base as build_deps

ARG BUILD_PACKAGES="git build-essential libpq-dev wget vim curl gzip xz-utils libsqlite3-dev"
ENV BUILD_PACKAGES ${BUILD_PACKAGES}

RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y ${BUILD_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

#######################################################################

# install gems

FROM build_deps as gems

COPY Gemfile* ./
RUN bundle install && rm -rf vendor/bundle/ruby/*/cache

#######################################################################

# install node modules

FROM build_deps as node_modules

COPY package*json ./
COPY yarn.* ./
RUN yarn install

#######################################################################

# install deployment packages

FROM base

ARG DEPLOY_PACKAGES="postgresql-client file vim curl gzip libsqlite3-0"
ENV DEPLOY_PACKAGES=${DEPLOY_PACKAGES}

RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y \
    ${DEPLOY_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

# copy installed gems
COPY --from=gems /app /app
COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
COPY --from=gems /usr/local/bundle /usr/local/bundle

# copy installed node modules
COPY --from=node_modules /app/node_modules /app/node_modules

#######################################################################

# Deploy your application
COPY . .

# Adjust binstubs to run on Linux and set current working directory
RUN chmod +x /app/bin/* && \
    sed -i 's/ruby.exe\r*/ruby/' /app/bin/* && \
    sed -i '/^#!/aDir.chdir File.expand_path("..", __dir__)' /app/bin/*

# The following enable assets to precompile on the build server.  Adjust
# as necessary.  If no combination works for you, see:
# https://fly.io/docs/rails/getting-started/existing/#access-to-environment-variables-at-build-time
ENV SECRET_KEY_BASE 1
# ENV AWS_ACCESS_KEY_ID=1
# ENV AWS_SECRET_ACCESS_KEY=1

# Run build task defined in lib/tasks/fly.rake
ARG BUILD_COMMAND="bin/rails fly:build"
RUN ${BUILD_COMMAND}

# Default server start instructions.  Generally Overridden by fly.toml.
ENV PORT 8080
ARG SERVER_COMMAND="bin/rails fly:server"
ENV SERVER_COMMAND ${SERVER_COMMAND}
CMD ${SERVER_COMMAND}

fly.toml

# fly.toml file generated for nailier on 2022-12-12T11:00:08+09:00

app = "nailier"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  [build.args]
    BUILD_COMMAND = "bin/rails fly:build"
    SERVER_COMMAND = "bin/rails fly:server"

[deploy]
  release_command = "bin/rails fly:release"

[env]
  PORT = "8080"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

[[statics]]
  guest_path = "/app/public"
  url_prefix = "/"

[mounts]
  source="nailier_active_storage_data"
  destination="/data"

I added .yarnrc and listed networkConcurrency: 1, but cannot deploy.
I had fly deploy many times in a short period of time, could that be the cause?
Would increasing the amount of memory help?

Do you have any solutions to this problem?

I tried deploying with another app and it failed on yarn install.

% fly deploy   
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-hidden-pond-1135 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 0.8s (0/1)                                                                                                    
[+] Building 5.3s (18/25)                                                                                                  
 => CACHED [internal] load remote build context                                                                       0.0s
 => CACHED copy /context /                                                                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                 1.6s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b  0.0s
 => [internal] load metadata for quay.io/evl.ms/fullstaq-ruby:3.0.4-jemalloc-slim                                     1.1s
 => [base 1/6] FROM quay.io/evl.ms/fullstaq-ruby:3.0.4-jemalloc-slim@sha256:a969fd121c1b46326d2555814aee7fd099a9bc8f  0.0s
 => CACHED [base 2/6] RUN mkdir /app                                                                                  0.0s
 => CACHED [base 3/6] WORKDIR /app                                                                                    0.0s
 => CACHED [base 4/6] RUN mkdir -p tmp/pids                                                                           0.0s
 => CACHED [base 5/6] RUN curl https://get.volta.sh | bash                                                            0.0s
 => CACHED [base 6/6] RUN volta install node@16.13.0 yarn@1.22.17 &&     gem update --system --no-document &&     ge  0.0s
 => CACHED [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt     --mount  0.0s
 => CACHED [gems 1/2] COPY Gemfile* ./                                                                                0.0s
 => ERROR [gems 2/2] RUN bundle install && rm -rf vendor/bundle/ruby/*/cache                                          2.4s
 => CACHED [stage-4 1/8] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt     --mount=t  0.0s
 => CACHED [node_modules 1/3] COPY package*json ./                                                                    0.0s
 => CACHED [node_modules 2/3] COPY yarn.* ./                                                                          0.0s
 => CANCELED [node_modules 3/3] RUN yarn install                                                                      2.5s
------                                                                                                                     
 > [gems 2/2] RUN bundle install && rm -rf vendor/bundle/ruby/*/cache:                                                     
#15 1.480 Fetching gem metadata from https://rubygems.org/....                                                             
#15 2.278 Retrying fetcher due to error (2/4): Errno::ENOSPC No space left on device @ dir_s_mkdir - /tmp/bundler-compact-index-20221226-7-6ka97a
#15 2.278 .
#15 2.279 Retrying fetcher due to error (3/4): Bundler::NoSpaceOnDeviceError There was an error while trying to write to `/tmp/bundler-compact-index-20221226-7-lio4mx/hitimes`. There was insufficient space remaining on the device.
#15 2.283 .
#15 2.283 Retrying fetcher due to error (4/4): Bundler::NoSpaceOnDeviceError There was an error while trying to write to `/tmp/bundler-compact-index-20221226-7-8bgaba/coveralls`. There was insufficient space remaining on the device.
#15 2.284 .
#15 2.308 --- ERROR REPORT TEMPLATE -------------------------------------------------------
#15 2.308 
#15 2.308 ```
#15 2.308 Errno::ENOSPC: No space left on device @ dir_s_mkdir - /tmp/bundler-compact-index-20221226-7-qbrqo9
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/vendor/tmpdir/lib/tmpdir.rb:92:in `mkdir'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/vendor/tmpdir/lib/tmpdir.rb:92:in `block in mktmpdir'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/vendor/tmpdir/lib/tmpdir.rb:144:in `create'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/vendor/tmpdir/lib/tmpdir.rb:90:in `mktmpdir'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/compact_index_client/updater.rb:29:in `update'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/compact_index_client.rb:98:in `update'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/compact_index_client.rb:114:in `update_info'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/compact_index_client.rb:71:in `block in dependencies'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/fetcher/compact_index.rb:97:in `block (2 levels) in parallel_compact_index_client'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/worker.rb:62:in `apply_func'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/worker.rb:57:in `block in process_queue'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/worker.rb:54:in `loop'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/worker.rb:54:in `process_queue'
#15 2.308   /usr/local/bundle/gems/bundler-2.2.33/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'
#15 2.308 ```
#15 2.308 
#15 2.308 ## Environment
#15 2.308 
#15 2.308 ```
#15 2.308 Bundler       2.2.33
#15 2.308   Platforms   ruby, x86_64-linux
#15 2.308 Ruby          3.0.4p208 (2022-04-12 revision 3fa771ddedac25560be57f4055f1767e6c810f58) [x86_64-linux]
#15 2.308   Full Path   /usr/lib/fullstaq-ruby/versions/3.0.4-jemalloc/bin/ruby
#15 2.308   Config Dir  /usr/lib/fullstaq-ruby/versions/3.0.4-jemalloc/etc
#15 2.308 RubyGems      3.4.1
#15 2.308   Gem Home    /app/vendor/bundle/ruby/3.0.0
#15 2.308   Gem Path    /app/vendor/bundle/ruby/3.0.0
#15 2.308   User Home   /root
#15 2.308   User Path   /root/.local/share/gem/ruby/3.0.0
#15 2.308   Bin Dir     /app/vendor/bundle/ruby/3.0.0/bin
#15 2.308 OpenSSL       
#15 2.308   Compiled    OpenSSL 1.1.1n  15 Mar 2022
#15 2.308   Loaded      OpenSSL 1.1.1n  15 Mar 2022
#15 2.308   Cert File   /usr/lib/ssl/cert.pem
#15 2.308   Cert Dir    /usr/lib/ssl/certs
#15 2.308 Tools         
#15 2.308   Git         2.20.1
#15 2.308   RVM         not installed
#15 2.308   rbenv       not installed
#15 2.308   chruby      not installed
#15 2.308 ```
#15 2.308 
#15 2.308 ## Bundler Build Metadata
#15 2.308 
#15 2.308 ```
#15 2.308 Built At          2021-12-07
#15 2.308 Git SHA           9b5e2a350b
#15 2.308 Released Version  true
#15 2.308 ```
#15 2.308 
#15 2.308 ## Bundler settings
#15 2.308 
#15 2.308 ```
#15 2.308 app_config
#15 2.308   Set via BUNDLE_APP_CONFIG: "/usr/local/bundle"
#15 2.308 path
#15 2.308   Set via BUNDLE_PATH: "vendor/bundle"
#15 2.308 silence_root_warning
#15 2.308   Set via BUNDLE_SILENCE_ROOT_WARNING: true
#15 2.308 without
#15 2.308   Set for your local app (/usr/local/bundle/config): [:development, :test]
#15 2.308   Set via BUNDLE_WITHOUT: [:development, :test]
#15 2.308 ```
#15 2.308 
#15 2.308 ## Gemfile
#15 2.308 
#15 2.308 ### Gemfile
#15 2.308 
#15 2.308 ```ruby
#15 2.308 # frozen_string_literal: true
#15 2.308 
#15 2.308 source 'https://rubygems.org'
#15 2.308 git_source(:github) { |repo| "https://github.com/#{repo}.git" }
#15 2.308 
#15 2.308 ruby '3.0.4'
#15 2.308 
#15 2.308 # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
#15 2.308 gem 'rails', '~> 6.1.6'
#15 2.308 # Use postgresql as the database for Active Record
#15 2.308 gem 'pg', '~> 1.1'
#15 2.308 # Use Puma as the app server
#15 2.308 gem 'puma', '~> 5.0'
#15 2.308 # Use SCSS for stylesheets
#15 2.308 gem 'sass-rails', '>= 6'
#15 2.308 # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
#15 2.308 gem 'webpacker', '~> 5.0'
#15 2.308 # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
#15 2.308 gem 'turbolinks', '~> 5'
#15 2.308 # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
#15 2.308 gem 'jbuilder', '~> 2.7'
#15 2.308 # Use Redis adapter to run Action Cable in production
#15 2.308 # gem 'redis', '~> 4.0'
#15 2.308 # Use Active Model has_secure_password
#15 2.308 # gem 'bcrypt', '~> 3.1.7'
#15 2.308 
#15 2.308 # Use Active Storage variant
#15 2.308 # gem 'image_processing', '~> 1.2'
#15 2.308 
#15 2.308 # Reduces boot times through caching; required in config/boot.rb
#15 2.308 gem 'bootsnap', '>= 1.4.4', require: false
#15 2.308 
#15 2.308 group :development, :test do
#15 2.308   # Call 'byebug' anywhere in the code to stop execution and get a debugger console
#15 2.308   gem 'byebug', platforms: %i[mri mingw x64_mingw]
#15 2.308   gem 'rspec-rails'
#15 2.308   gem 'rubyzip', '2.3.0'
#15 2.308 end
#15 2.308 
#15 2.308 group :development do
#15 2.308   # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
#15 2.308   gem 'web-console', '>= 4.1.0'
#15 2.308   # Display performance information such as SQL time and flame graphs for each request in your browser.
#15 2.308   # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
#15 2.308   gem 'listen', '~> 3.3'
#15 2.308   gem 'rack-mini-profiler', '~> 2.0'
#15 2.308   # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
#15 2.308   gem 'spring'
#15 2.308 
#15 2.308   gem 'rubocop-fjord', require: false
#15 2.308   gem 'rubocop-rails', require: false
#15 2.308 end
#15 2.308 
#15 2.308 group :test do
#15 2.308   # Adds support for Capybara system testing and selenium driver
#15 2.308   gem 'capybara', '>= 3.26'
#15 2.308   gem 'selenium-webdriver', '>= 4.0.0.rc1'
#15 2.308   # Easy installation and use of web drivers to run system tests with browsers
#15 2.308   gem 'webdrivers'
#15 2.308 end
#15 2.308 
#15 2.308 # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
#15 2.308 gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
#15 2.308 
#15 2.308 gem 'active_storage_base64'
#15 2.308 gem 'devise'
#15 2.308 gem 'devise-i18n'
#15 2.308 gem 'rails-i18n'
#15 2.308 ```
#15 2.308 
#15 2.308 ### Gemfile.lock
#15 2.308 
#15 2.308 ```
#15 2.308 GEM
#15 2.308   remote: https://rubygems.org/
#15 2.308   specs:
#15 2.308     actioncable (6.1.6)
#15 2.308       actionpack (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       nio4r (~> 2.0)
#15 2.308       websocket-driver (>= 0.6.1)
#15 2.308     actionmailbox (6.1.6)
#15 2.308       actionpack (= 6.1.6)
#15 2.308       activejob (= 6.1.6)
#15 2.308       activerecord (= 6.1.6)
#15 2.308       activestorage (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       mail (>= 2.7.1)
#15 2.308     actionmailer (6.1.6)
#15 2.308       actionpack (= 6.1.6)
#15 2.308       actionview (= 6.1.6)
#15 2.308       activejob (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       mail (~> 2.5, >= 2.5.4)
#15 2.308       rails-dom-testing (~> 2.0)
#15 2.308     actionpack (6.1.6)
#15 2.308       actionview (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       rack (~> 2.0, >= 2.0.9)
#15 2.308       rack-test (>= 0.6.3)
#15 2.308       rails-dom-testing (~> 2.0)
#15 2.308       rails-html-sanitizer (~> 1.0, >= 1.2.0)
#15 2.308     actiontext (6.1.6)
#15 2.308       actionpack (= 6.1.6)
#15 2.308       activerecord (= 6.1.6)
#15 2.308       activestorage (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       nokogiri (>= 1.8.5)
#15 2.308     actionview (6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       builder (~> 3.1)
#15 2.308       erubi (~> 1.4)
#15 2.308       rails-dom-testing (~> 2.0)
#15 2.308       rails-html-sanitizer (~> 1.1, >= 1.2.0)
#15 2.308     active_storage_base64 (1.2.0)
#15 2.308       rails (~> 6.1)
#15 2.308     activejob (6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       globalid (>= 0.3.6)
#15 2.308     activemodel (6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308     activerecord (6.1.6)
#15 2.308       activemodel (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308     activestorage (6.1.6)
#15 2.308       actionpack (= 6.1.6)
#15 2.308       activejob (= 6.1.6)
#15 2.308       activerecord (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       marcel (~> 1.0)
#15 2.308       mini_mime (>= 1.1.0)
#15 2.308     activesupport (6.1.6)
#15 2.308       concurrent-ruby (~> 1.0, >= 1.0.2)
#15 2.308       i18n (>= 1.6, < 2)
#15 2.308       minitest (>= 5.1)
#15 2.308       tzinfo (~> 2.0)
#15 2.308       zeitwerk (~> 2.3)
#15 2.308     addressable (2.8.0)
#15 2.308       public_suffix (>= 2.0.2, < 5.0)
#15 2.308     ast (2.4.2)
#15 2.308     bcrypt (3.1.18)
#15 2.308     bindex (0.8.1)
#15 2.308     bootsnap (1.12.0)
#15 2.308       msgpack (~> 1.2)
#15 2.308     builder (3.2.4)
#15 2.308     byebug (11.1.3)
#15 2.308     capybara (3.37.1)
#15 2.308       addressable
#15 2.308       matrix
#15 2.308       mini_mime (>= 0.1.3)
#15 2.308       nokogiri (~> 1.8)
#15 2.308       rack (>= 1.6.0)
#15 2.308       rack-test (>= 0.6.3)
#15 2.308       regexp_parser (>= 1.5, < 3.0)
#15 2.308       xpath (~> 3.2)
#15 2.308     childprocess (4.1.0)
#15 2.308     concurrent-ruby (1.1.10)
#15 2.308     crass (1.0.6)
#15 2.308     devise (4.8.1)
#15 2.308       bcrypt (~> 3.0)
#15 2.308       orm_adapter (~> 0.1)
#15 2.308       railties (>= 4.1.0)
#15 2.308       responders
#15 2.308       warden (~> 1.2.3)
#15 2.308     devise-i18n (1.10.2)
#15 2.308       devise (>= 4.8.0)
#15 2.308     diff-lcs (1.5.0)
#15 2.308     erubi (1.10.0)
#15 2.308     ffi (1.15.5)
#15 2.308     globalid (1.0.0)
#15 2.308       activesupport (>= 5.0)
#15 2.308     i18n (1.10.0)
#15 2.308       concurrent-ruby (~> 1.0)
#15 2.308     jbuilder (2.11.5)
#15 2.308       actionview (>= 5.0.0)
#15 2.308       activesupport (>= 5.0.0)
#15 2.308     json (2.6.2)
#15 2.308     listen (3.7.1)
#15 2.308       rb-fsevent (~> 0.10, >= 0.10.3)
#15 2.308       rb-inotify (~> 0.9, >= 0.9.10)
#15 2.308     loofah (2.18.0)
#15 2.308       crass (~> 1.0.2)
#15 2.308       nokogiri (>= 1.5.9)
#15 2.308     mail (2.7.1)
#15 2.308       mini_mime (>= 0.1.1)
#15 2.308     marcel (1.0.2)
#15 2.308     matrix (0.4.2)
#15 2.308     method_source (1.0.0)
#15 2.308     mini_mime (1.1.2)
#15 2.308     mini_portile2 (2.8.0)
#15 2.308     minitest (5.16.2)
#15 2.308     msgpack (1.5.3)
#15 2.308     nio4r (2.5.8)
#15 2.308     nokogiri (1.13.6)
#15 2.308       mini_portile2 (~> 2.8.0)
#15 2.308       racc (~> 1.4)
#15 2.308     nokogiri (1.13.6-x86_64-darwin)
#15 2.308       racc (~> 1.4)
#15 2.308     nokogiri (1.13.6-x86_64-linux)
#15 2.308       racc (~> 1.4)
#15 2.308     orm_adapter (0.5.0)
#15 2.308     parallel (1.22.1)
#15 2.308     parser (3.1.2.1)
#15 2.308       ast (~> 2.4.1)
#15 2.308     pg (1.4.1)
#15 2.308     public_suffix (4.0.7)
#15 2.308     puma (5.6.4)
#15 2.308       nio4r (~> 2.0)
#15 2.308     racc (1.6.0)
#15 2.308     rack (2.2.4)
#15 2.308     rack-mini-profiler (2.3.4)
#15 2.308       rack (>= 1.2.0)
#15 2.308     rack-proxy (0.7.2)
#15 2.308       rack
#15 2.308     rack-test (2.0.2)
#15 2.308       rack (>= 1.3)
#15 2.308     rails (6.1.6)
#15 2.308       actioncable (= 6.1.6)
#15 2.308       actionmailbox (= 6.1.6)
#15 2.308       actionmailer (= 6.1.6)
#15 2.308       actionpack (= 6.1.6)
#15 2.308       actiontext (= 6.1.6)
#15 2.308       actionview (= 6.1.6)
#15 2.308       activejob (= 6.1.6)
#15 2.308       activemodel (= 6.1.6)
#15 2.308       activerecord (= 6.1.6)
#15 2.308       activestorage (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       bundler (>= 1.15.0)
#15 2.308       railties (= 6.1.6)
#15 2.308       sprockets-rails (>= 2.0.0)
#15 2.308     rails-dom-testing (2.0.3)
#15 2.308       activesupport (>= 4.2.0)
#15 2.308       nokogiri (>= 1.6)
#15 2.308     rails-html-sanitizer (1.4.3)
#15 2.308       loofah (~> 2.3)
#15 2.308     rails-i18n (7.0.6)
#15 2.308       i18n (>= 0.7, < 2)
#15 2.308       railties (>= 6.0.0, < 8)
#15 2.308     railties (6.1.6)
#15 2.308       actionpack (= 6.1.6)
#15 2.308       activesupport (= 6.1.6)
#15 2.308       method_source
#15 2.308       rake (>= 12.2)
#15 2.308       thor (~> 1.0)
#15 2.308     rainbow (3.1.1)
#15 2.308     rake (13.0.6)
#15 2.308     rb-fsevent (0.11.1)
#15 2.308     rb-inotify (0.10.1)
#15 2.308       ffi (~> 1.0)
#15 2.308     regexp_parser (2.5.0)
#15 2.308     responders (3.0.1)
#15 2.308       actionpack (>= 5.0)
#15 2.308       railties (>= 5.0)
#15 2.308     rexml (3.2.5)
#15 2.308     rspec-core (3.11.0)
#15 2.308       rspec-support (~> 3.11.0)
#15 2.308     rspec-expectations (3.11.0)
#15 2.308       diff-lcs (>= 1.2.0, < 2.0)
#15 2.308       rspec-support (~> 3.11.0)
#15 2.308     rspec-mocks (3.11.1)
#15 2.308       diff-lcs (>= 1.2.0, < 2.0)
#15 2.308       rspec-support (~> 3.11.0)
#15 2.308     rspec-rails (5.1.2)
#15 2.308       actionpack (>= 5.2)
#15 2.308       activesupport (>= 5.2)
#15 2.308       railties (>= 5.2)
#15 2.308       rspec-core (~> 3.10)
#15 2.308       rspec-expectations (~> 3.10)
#15 2.308       rspec-mocks (~> 3.10)
#15 2.308       rspec-support (~> 3.10)
#15 2.308     rspec-support (3.11.0)
#15 2.308     rubocop (1.35.0)
#15 2.308       json (~> 2.3)
#15 2.308       parallel (~> 1.10)
#15 2.308       parser (>= 3.1.2.1)
#15 2.308       rainbow (>= 2.2.2, < 4.0)
#15 2.308       regexp_parser (>= 1.8, < 3.0)
#15 2.308       rexml (>= 3.2.5, < 4.0)
#15 2.308       rubocop-ast (>= 1.20.1, < 2.0)
#15 2.308       ruby-progressbar (~> 1.7)
#15 2.308       unicode-display_width (>= 1.4.0, < 3.0)
#15 2.308     rubocop-ast (1.21.0)
#15 2.308       parser (>= 3.1.1.0)
#15 2.308     rubocop-fjord (0.2.2)
#15 2.308       rubocop (>= 1.0)
#15 2.308       rubocop-performance
#15 2.308     rubocop-performance (1.14.3)
#15 2.308       rubocop (>= 1.7.0, < 2.0)
#15 2.308       rubocop-ast (>= 0.4.0)
#15 2.308     rubocop-rails (2.15.2)
#15 2.308       activesupport (>= 4.2.0)
#15 2.308       rack (>= 1.1)
#15 2.308       rubocop (>= 1.7.0, < 2.0)
#15 2.308     ruby-progressbar (1.11.0)
#15 2.308     rubyzip (2.3.0)
#15 2.308     sass-rails (6.0.0)
#15 2.308       sassc-rails (~> 2.1, >= 2.1.1)
#15 2.308     sassc (2.4.0)
#15 2.308       ffi (~> 1.9)
#15 2.308     sassc-rails (2.1.2)
#15 2.308       railties (>= 4.0.0)
#15 2.308       sassc (>= 2.0)
#15 2.308       sprockets (> 3.0)
#15 2.308       sprockets-rails
#15 2.308       tilt
#15 2.308     selenium-webdriver (4.3.0)
#15 2.308       childprocess (>= 0.5, < 5.0)
#15 2.308       rexml (~> 3.2, >= 3.2.5)
#15 2.308       rubyzip (>= 1.2.2, < 3.0)
#15 2.308       websocket (~> 1.0)
#15 2.308     semantic_range (3.0.0)
#15 2.308     spring (4.0.0)
#15 2.308     sprockets (4.1.1)
#15 2.308       concurrent-ruby (~> 1.0)
#15 2.308       rack (> 1, < 3)
#15 2.308     sprockets-rails (3.4.2)
#15 2.308       actionpack (>= 5.2)
#15 2.308       activesupport (>= 5.2)
#15 2.308       sprockets (>= 3.0.0)
#15 2.308     thor (1.2.1)
#15 2.308     tilt (2.0.10)
#15 2.308     turbolinks (5.2.1)
#15 2.308       turbolinks-source (~> 5.2)
#15 2.308     turbolinks-source (5.2.0)
#15 2.308     tzinfo (2.0.4)
#15 2.308       concurrent-ruby (~> 1.0)
#15 2.308     unicode-display_width (2.2.0)
#15 2.308     warden (1.2.9)
#15 2.308       rack (>= 2.0.9)
#15 2.308     web-console (4.2.0)
#15 2.308       actionview (>= 6.0.0)
#15 2.308       activemodel (>= 6.0.0)
#15 2.308       bindex (>= 0.4.0)
#15 2.308       railties (>= 6.0.0)
#15 2.308     webdrivers (5.0.0)
#15 2.308       nokogiri (~> 1.6)
#15 2.308       rubyzip (>= 1.3.0)
#15 2.308       selenium-webdriver (~> 4.0)
#15 2.308     webpacker (5.4.3)
#15 2.308       activesupport (>= 5.2)
#15 2.308       rack-proxy (>= 0.6.1)
#15 2.308       railties (>= 5.2)
#15 2.308       semantic_range (>= 2.3.0)
#15 2.308     websocket (1.2.9)
#15 2.308     websocket-driver (0.7.5)
#15 2.308       websocket-extensions (>= 0.1.0)
#15 2.308     websocket-extensions (0.1.5)
#15 2.308     xpath (3.2.0)
#15 2.308       nokogiri (~> 1.8)
#15 2.308     zeitwerk (2.6.0)
#15 2.308 
#15 2.308 PLATFORMS
#15 2.308   ruby
#15 2.308   x86_64-darwin-20
#15 2.308   x86_64-linux
#15 2.308 
#15 2.308 DEPENDENCIES
#15 2.308   active_storage_base64
#15 2.308   bootsnap (>= 1.4.4)
#15 2.308   byebug
#15 2.308   capybara (>= 3.26)
#15 2.308   devise
#15 2.308   devise-i18n
#15 2.308   jbuilder (~> 2.7)
#15 2.308   listen (~> 3.3)
#15 2.308   pg (~> 1.1)
#15 2.308   puma (~> 5.0)
#15 2.308   rack-mini-profiler (~> 2.0)
#15 2.308   rails (~> 6.1.6)
#15 2.308   rails-i18n
#15 2.308   rspec-rails
#15 2.308   rubocop-fjord
#15 2.308   rubocop-rails
#15 2.308   rubyzip (= 2.3.0)
#15 2.308   sass-rails (>= 6)
#15 2.308   selenium-webdriver (>= 4.0.0.rc1)
#15 2.308   spring
#15 2.308   turbolinks (~> 5)
#15 2.308   tzinfo-data
#15 2.308   web-console (>= 4.1.0)
#15 2.308   webdrivers
#15 2.308   webpacker (~> 5.0)
#15 2.308 
#15 2.308 RUBY VERSION
#15 2.308    ruby 3.0.4p208
#15 2.308 
#15 2.308 BUNDLED WITH
#15 2.308    2.2.33
#15 2.308 ```
#15 2.308 
#15 2.308 --- TEMPLATE END ----------------------------------------------------------------
#15 2.308 
#15 2.308 Unfortunately, an unexpected error occurred, and Bundler cannot continue.
#15 2.308 
#15 2.308 First, try this link to see if there are any existing issue reports for this error:
#15 2.308 https://github.com/rubygems/rubygems/search?q=No+space+left+on+device+%40+dir_s_mkdir+-+%2Ftmp%2Fbundler-compact-index-20221226-7-qbrqo9&type=Issues
#15 2.308 
#15 2.308 If there aren't any reports for this error yet, please fill in the new issue form located at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md, and copy and paste the report template above in there.
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -o pipefail -c bundle install && rm -rf vendor/bundle/ruby/*/cache]: exit code: 1

Two things to try.

The easiest fix is to add --production=false on the RUN yarn install in your Dockerfile. This won’t install development dependencies, which you may not need at runtime. This may not work if something you actually need at runtime is listed as a development dependency.

If that doesn’t work for you, try removing the FROM build_deps as gems and FROM build_deps as node_modules lines from your dockerfile, and change the later COPY statements to copy from build_deps instead:

# copy installed gems
COPY --from=build_deps /app /app
COPY --from=build_deps /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
COPY --from=build_deps /usr/local/bundle /usr/local/bundle

# copy installed node modules
COPY --from=build_deps /app/node_modules /app/node_modules

The current dockerfile is set up to install gems and npm modules in parallel, but that may require too much disk space for your application. Installing these serially will take longer, but may fit.

Thanks for the reply.
Both resulted in errors…
Is there a mistake in this code?

1st way
Dockerfile

RUN yarn install --production=false
% fly deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-hidden-pond-1135 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 3.0s (0/1)                                                                                                       
[+] Building 7.1s (15/25)                                                                                                     
 => [internal] load remote build context                                                                                 0.0s
 => copy /context /                                                                                                      0.2s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                    1.6s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2  0.0s
 => [internal] load metadata for quay.io/evl.ms/fullstaq-ruby:3.0.4-jemalloc-slim                                        0.8s
 => [base 1/6] FROM quay.io/evl.ms/fullstaq-ruby:3.0.4-jemalloc-slim@sha256:a969fd121c1b46326d2555814aee7fd099a9bc8fbfa  0.0s
 => CACHED [base 2/6] RUN mkdir /app                                                                                     0.0s
 => CACHED [base 3/6] WORKDIR /app                                                                                       0.0s
 => CACHED [base 4/6] RUN mkdir -p tmp/pids                                                                              0.0s
 => CACHED [base 5/6] RUN curl https://get.volta.sh | bash                                                               0.0s
 => CACHED [base 6/6] RUN volta install node@16.13.0 yarn@1.22.17 &&     gem update --system --no-document &&     gem i  0.0s
 => CACHED [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt     --mount=ty  0.0s
 => CACHED [node_modules 1/3] COPY package*json ./                                                                       0.0s
 => CACHED [node_modules 2/3] COPY yarn.* ./                                                                             0.0s
 => ERROR [node_modules 3/3] RUN yarn install --production=false                                                         4.0s
------                                                                                                                        
 > [node_modules 3/3] RUN yarn install --production=false:                                                                    
#21 0.930 yarn install v1.22.17                                                                                               
#21 1.044 [1/4] Resolving packages...                                                                                         
#21 1.484 [2/4] Fetching packages...
#21 3.587 error An unexpected error occurred: "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz: ENOSPC: no space left on device, open '/usr/local/share/.cache/yarn/v6/npm-js-yaml-3.14.1-dae812fdb3825fa306609a8717383c50c36a0537-integrity/node_modules/js-yaml/.yarn-tarball.tgz'".
#21 3.588 info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
#21 3.588 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -o pipefail -c yarn install --production=false]: exit code: 1

2st way
Dockerfile

# syntax = docker/dockerfile:experimental

# Dockerfile used to build a deployable image for a Rails application.
# Adjust as required.
#
# Common adjustments you may need to make over time:
#  * Modify version numbers for Ruby, Bundler, and other products.
#  * Add library packages needed at build time for your gems, node modules.
#  * Add deployment packages needed by your application
#  * Add (often fake) secrets needed to compile your assets

#######################################################################

# Learn more about the chosen Ruby stack, Fullstaq Ruby, here:
#   https://github.com/evilmartians/fullstaq-ruby-docker.
#
# We recommend using the highest patch level for better security and
# performance.

ARG RUBY_VERSION=3.0.4
ARG VARIANT=jemalloc-slim
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base

LABEL fly_launch_runtime="rails"

ARG NODE_VERSION=16.13.0
ARG YARN_VERSION=1.22.17
ARG BUNDLER_VERSION=2.3.6

ARG RAILS_ENV=production
ENV RAILS_ENV=${RAILS_ENV}

ENV RAILS_SERVE_STATIC_FILES true
ENV RAILS_LOG_TO_STDOUT true

ARG BUNDLE_WITHOUT=development:test
ARG BUNDLE_PATH=vendor/bundle
ENV BUNDLE_PATH ${BUNDLE_PATH}
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}

RUN mkdir /app
WORKDIR /app
RUN mkdir -p tmp/pids

RUN curl https://get.volta.sh | bash
ENV VOLTA_HOME /root/.volta
ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH
RUN volta install node@${NODE_VERSION} yarn@${YARN_VERSION} && \
    gem update --system --no-document && \
    gem install -N bundler -v ${BUNDLER_VERSION}

#######################################################################

# install packages only needed at build time

FROM base as build_deps

ARG BUILD_PACKAGES="git build-essential libpq-dev wget vim curl gzip xz-utils libsqlite3-dev"
ENV BUILD_PACKAGES ${BUILD_PACKAGES}

RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y ${BUILD_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

#######################################################################

# install gems

# FROM build_deps as gems

COPY Gemfile* ./
RUN bundle install && rm -rf vendor/bundle/ruby/*/cache

#######################################################################

# install node modules

# FROM build_deps as node_modules

COPY package*json ./
COPY yarn.* ./
RUN yarn install --production=false

#######################################################################

# install deployment packages

FROM base

ARG DEPLOY_PACKAGES="postgresql-client file vim curl gzip libsqlite3-0"
ENV DEPLOY_PACKAGES=${DEPLOY_PACKAGES}

RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y \
    ${DEPLOY_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

# copy installed gems
COPY --from=build_deps /app /app
COPY --from=build_deps /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
COPY --from=build_deps /usr/local/bundle /usr/local/bundle
# COPY --from=gems /app /app
# COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
# COPY --from=gems /usr/local/bundle /usr/local/bundle

# copy installed node modules
COPY --from=build_deps /app/node_modules /app/node_modules
# COPY --from=node_modules /app/node_modules /app/node_modules

#######################################################################

# Deploy your application
COPY . .

# Adjust binstubs to run on Linux and set current working directory
RUN chmod +x /app/bin/* && \
    sed -i 's/ruby.exe\r*/ruby/' /app/bin/* && \
    sed -i '/^#!/aDir.chdir File.expand_path("..", __dir__)' /app/bin/*

# The following enable assets to precompile on the build server.  Adjust
# as necessary.  If no combination works for you, see:
# https://fly.io/docs/rails/getting-started/existing/#access-to-environment-variables-at-build-time
ENV SECRET_KEY_BASE 1
# ENV AWS_ACCESS_KEY_ID=1
# ENV AWS_SECRET_ACCESS_KEY=1

# Run build task defined in lib/tasks/fly.rake
ARG BUILD_COMMAND="bin/rails fly:build"
RUN ${BUILD_COMMAND}

# Default server start instructions.  Generally Overridden by fly.toml.
ENV PORT 8080
ARG SERVER_COMMAND="bin/rails fly:server"
ENV SERVER_COMMAND ${SERVER_COMMAND}
CMD ${SERVER_COMMAND}
% fly deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-hidden-pond-1135 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 8.8s (0/1)                                                                                                       
[+] Building 0.2s (2/2) FINISHED                                                                                              
 => [internal] load remote build context                                                                                 0.0s
 => ERROR copy /context /                                                                                                0.1s
------
 > copy /context /:
------
Error failed to fetch an image or build from source: error building: failed to solve with frontend dockerfile.v0: failed to read dockerfile: Error processing tar file(exit status 1): open /config/locales/ja.yml: no space left on device

OK, still the same error:

Any chance you can post your package.json file, specifically the dependencies portion?

Contents of package.json

{
  "name": "nailier",
  "private": true,
  "scripts": {
    "lint": "run-p lint:*",
    "lint:eslint": "eslint 'app/javascript/**/*.{js,vue}' --max-warnings=0",
    "lint:prettier": "prettier app/javascript/**/*.{js,vue} --check"
  },
  "dependencies": {
    "@rails/actioncable": "^6.1.6",
    "@rails/activestorage": "^6.1.6",
    "@rails/ujs": "^6.1.6",
    "@rails/webpacker": "5.4.3",
    "autoprefixer": "10",
    "axios": "^0.27.2",
    "postcss": "8",
    "postcss-loader": "4",
    "postcss-preset-env": "7",
    "tailwindcss": "3",
    "turbolinks": "^5.2.0",
    "vue": "^2.7.10",
    "vue-color": "^2.8.1",
    "vue-easy-lightbox": "^0.20.0",
    "vue-loader": "^15.10.0",
    "vue-template-compiler": "^2.7.10",
    "vue-youtube": "^1.4.0",
    "vuedraggable": "^2.24.3",
    "webpack": "^4.46.0",
    "webpack-cli": "^3.3.12"
  },
  "version": "0.1.0",
  "devDependencies": {
    "eslint": "^8.23.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-vue": "^9.4.0",
    "eslint-webpack-plugin": "^3.2.0",
    "npm-run-all": "^4.1.5",
    "prettier": "^2.7.1",
    "prettier-config-standard": "^5.0.0",
    "webpack-dev-server": "^3"
  }
}

Just to jump in here, one thing that can happen when you do repeated deploys is that the disk on the remote builder can get full. Only I see the same builder name appear in your logs. It’s possible it’s as simple as that. That would explain an “out of space” error.

You could try deleting it. Run fly apps destroy fly-builder-hidden-pond-1135.

Then when you next deploy, Fly will see you don’t have a remote builder and will make a new one. With a new, empty disk:

If it’s not that, I’m out of ideas and it’s back over to @rubys :slight_smile:

1 Like

Here’s the error I get when I try with that package.json:

 > [builder 8/8] RUN npm install:                                                                                                     
#10 7.765 npm ERR! code ERESOLVE                                                                                                      
#10 7.768 npm ERR! ERESOLVE unable to resolve dependency tree                                                                         
#10 7.768 npm ERR!                                                                                                                    
#10 7.768 npm ERR! While resolving: nailier@0.1.0                                                                                     
#10 7.768 npm ERR! Found: webpack@4.46.0
#10 7.769 npm ERR! node_modules/webpack
#10 7.769 npm ERR!   webpack@"^4.46.0" from the root project
#10 7.769 npm ERR!   peer webpack@"^3.0.0 || ^4.1.0 || ^5.0.0-0" from vue-loader@15.10.1
#10 7.769 npm ERR!   node_modules/vue-loader
#10 7.769 npm ERR!     vue-loader@"^15.10.0" from the root project
#10 7.770 npm ERR! 
#10 7.770 npm ERR! Could not resolve dependency:
#10 7.770 npm ERR! peer webpack@"^5.0.0" from css-loader@6.7.3
#10 7.770 npm ERR! node_modules/css-loader
#10 7.770 npm ERR!   peer css-loader@"*" from vue-loader@15.10.1
#10 7.770 npm ERR!   node_modules/vue-loader
#10 7.770 npm ERR!     vue-loader@"^15.10.0" from the root project
#10 7.770 npm ERR! 
#10 7.771 npm ERR! Fix the upstream dependency conflict, or retry
#10 7.771 npm ERR! this command with --force or --legacy-peer-deps
#10 7.771 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
1 Like

I did fly apps destroy fly-builder-hidden-pond-1135 and was able to deploy!
I had to deploy over and over again.
Thank you!

1 Like

I did fly apps destroy fly-builder-hidden-pond-1135 and was able to deploy!
I had to deploy over and over again.
But I’m also concerned about the error in package.json, so I will check it out.
Thank you for looking into all of this!