Rails & Docker "Compilation failed: bundle exec rails assets:precompile RAILS_ENV=XXXXX exit code: 1"

Viewed 270

I have an annoying error continuously when I run docker-compose build or docker build .

My Docker file:

...
ADD . $ROOT
RUN bundle exec rails assets:precompile RAILS_ENV=production

Where I have a problem is this part:

RUN bundle exec rails assets:precompile RAILS_ENV=production

Error Message is

 > [12/12] RUN bundle exec rails assets:precompile RAILS_ENV=production
#18 3.263 yarn install
#18 3.374 [1/4] Resolving packages...
#18 3.773 [2/4] Fetching packages...
#18 8.321 [3/4] Linking dependencies...
#18 10.98 [4/4] Building fresh packages...
#18 11.51 Done in 8.26s.
#18 13.31 Compiling...
#18 46.03 Compilation failed:
#18 46.03

executor failed running [/bin/sh -c bundle exec rails assets:precompile]: exit code: 1

These messages did not help me at all when I investigate why it happened. Some say that it's caused by lacking memory, but how can I know from this error message and how to resolve it? Any Idea for this error? Thank you in advance.

ADD:
I tried to docker-compose build after I comment out bundle exec rails assets:precompile in Dockerfile.
And then, I ran
docker-compose run app bundle exec rails assets:precompile
I got the same error

Compiling...
Compilation failed:

ERROR: 1
0 Answers
Related