Giter VIP home page Giter VIP logo

ruby-docker's Introduction

Ruby Runtime for Google Cloud Platform

Travis-CI Build Status

This repository contains the source for the Ruby runtime for Google App Engine Flexible.

For more information on using the Ruby runtime, see https://cloud.google.com/appengine/docs/flexible/ruby/

Contents

This repository includes:

  • The base image atop Ubuntu 20_04, including the OS, common libraries and build dependencies, NodeJS, and rbenv, in the ruby-ubuntu20 directory.
  • A Dockerfile and config for building Ruby binary images in the ruby-prebuilt directory.
  • A convenience image, including the above Ubuntu image and a default installation of Ruby, in the ruby-base directory.
  • A raw image that contains installations of some common build tools and scripts, such as Yarn, the Google Cloud SQL Proxy, and the Google Cloud SDK, in the ruby-build-tools directory.
  • An image that analyzes a Ruby application and generates an appropriate Dockerfile, in the ruby-generate-dockerfile directory.
  • Templates for the Ruby runtime build pipeline definition in the ruby-pipeline directory.

This repository also contains a helper image, "app-engine-exec-wrapper" that provides a way to execute scripts in an App Engine application's environment. See the app-engine-exec-wrapper directory for more details.

The integration_test directory contains sample applications that are used by the Google Ruby team for runtime integration tests.

Local builds and tests

Toys tools are provided to build the images locally and run the unit tests in the test directory. The tools require current versions of Ruby and Docker.

To perform a local build and test:

gem install toys # If not already present
toys build
toys test

Note this procedure tests against production prebuilt Ruby binaries by default. To create and test a small number of locally-built binaries:

toys build --use-local-prebuilt
toys test --use-local-prebuilt

Release builds

Release candidates can be built using the build-*.sh scripts. Generally, they build artifacts, tagged with a build number, to a specified project (defaulting to the current gcloud project). Builds can be released using the release-*.sh scripts, which generally just retag a specified build as latest. Each of these scripts accepts a -h flag which documents the options.

Runtime images

To build and release runtime images, use the build-ruby-runtime-images.sh and release-ruby-runtime-images.sh scripts. When building, you may want to set the -s flag to tag the build as staging, and the -i flag to use a prebuilt binary for the convenience base image.

Official release builds of the runtime images are generally performed internally at Google. Such builds are roughly equivalent to:

./build-ruby-runtime-images.sh -i -p gcp-runtimes -s
./release-ruby-runtime-images.sh -p gcp-runtimes

Prebuilt binaries

To build and release prebuilt binary images, use the build-ruby-binary-images.sh and release-ruby-binary-images.sh scripts. When building, you should either set the -c flag or provide a prebuilt-versions.txt file to tell the runtime which Rubies to build. You may also want to set the -s flag to mark the new images as staging.

Official release builds of the prebuilt binaries are generally performed internally at Google. Such builds are roughly equivalent to:

./build-ruby-binary-images.sh -p gcp-runtimes -s -c <versions>
./release-ruby-binary-images.sh -p gcp-runtimes -c <versions>

The canonical list of prebuilt binaries is defined in the file ruby-pipeline/ruby-latest.yaml, which is the template used to build the official Ruby runtime. (This file also defines the default Ruby version used if an app does not specify a Ruby version.) To add to the canonical list, first build and release the prebuilt binary, then add an applicable entry to ruby-pipeline/ruby-latest.yaml and perform a template build (which must be done internally at Google.)

Runtime pipeline

To build and release the runtime pipeline config, use the build-ruby-runtime-pipeline.sh and release-ruby-runtime-pipeline.sh scripts. The -b flag is required. You may also want to set the -s flag to tag the pipeline build as staging. Finally, you should either set the -c flag, or provide a prebuilt-versions.txt file to tell the runtime which Rubies are prebuilt.

Official release builds of the pipeline are generally performed internally at at Google. Such builds are roughly equivalent to:

./build-ruby-runtime-pipeline.sh -b gcp-runtimes -p gcp-runtimes -s
./release-ruby-runtime-pipeline.sh -b gcp-runtimes -p gcp-runtimes

Exec Wrapper

To build and release the exec wrapper, use the build-app-engine-exec-wrapper.sh and release-app-engine-exec-wrapper.sh scripts. You may also want to set the -s flag to tag the build as staging.

Official release builds of the wrapper are generally performed internally at at Google. Such builds are roughly equivalent to:

./build-app-engine-exec-wrapper.sh -p google-appengine -s
./release-app-engine-exec-wrapper.sh -p google-appengine

Contributing changes

License

ruby-docker's People

Contributors

aandreassa avatar amurciasu avatar arhamahmed avatar bendory avatar brianburnszd avatar dansanabria avatar dazuma avatar dlorenc avatar donmccasland avatar dpzaba avatar glasnt avatar hxiong388 avatar jeadorf avatar justinbeckwith avatar knu avatar liangway avatar markmandel avatar nkubala avatar proppy avatar raggi avatar sharifelgamal avatar temikus avatar yugui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruby-docker's Issues

Google Appengine Ruby Docker image is grossly outdated

Hello,

The Google built Docker image for Google Appengine Flexible runtime is grossly outdated: the latest image was built on 3 May 2018, almost a year ago:

https://console.cloud.google.com/gcr/images/google-appengine/GLOBAL/ruby?gcrImageListsize=30

The issue with this image is that it relies on the jessy Debian release which support has now reached end of life: https://lists.debian.org/debian-devel-announce/2019/03/msg00006.html and any image built on top of that image (FROM gcr.io/google-appengine/ruby:latest), will yield this error:

Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)

The access_cloud_sql script may silently fail to connect due to missing access

Spent some time figuring out this gotcha: If the rake assets:precompile step require database access (which is very typical for large Rails apps), the Cloud SQL Proxy can fail to connect if the Cloud Build Service Account does not have the Cloud SQL Client role, but the build will still display "Ready for new connections".

This leads to the asset precompile step failing when it tries to connect to the database. Debugging further, I can see that the actual output from the Cloud SQL Proxy is:

Step #1: 2018/11/29 09:17:19 current FDs rlimit set to 1048576, wanted limit is 8500. Nothing to do here.
Step #1: 2018/11/29 09:17:21 errors parsing config:
Step #1: 	googleapi: Error 403: The client is not authorized to make this request., notAuthorized
Step #1: 2018/11/29 09:17:21 Ready for new connections

... but this is never passed on to the deploy output, so as an App Engine I'm left in the dark to what may be wrong. It could save others time to make this more clear in the output, and it would also be great if https://cloud.google.com/appengine/docs/flexible/ruby/using-cloud-sql-postgres included the information that the Cloud Build Service Account may need to have the Cloud SQL Client role.

apt-get update fails - Failed to fetch jessie backports repository

Since the jessie-updates repository has been removed, every attempt to run apt-get update fails with the following stacktrace:

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get update -qq && apt-get install liblcms2-utils' returned a non-zero code: 100
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 100

Maybe Google should just re-build and publish one image to fix it for everyone?

Plan to update the base OS version?

Thank you for maintaining the Ruby runtime images! Please allow me to ask a question. Is there a plan or ongoing project to update the base OS version?

All images are currently based on Ubuntu 16.04 LTS. It is stable and still works great, but it has been almost five years since it was released and it's becoming outdated 1, meaning you can use fewer and older packages for your application. There are already times where you need to manually build and install recent versions of software from the source and its dependencies instead of simply installing prebuilt packages on the fly using apt.

Looking at Circle CI and GitHub Actions, their officially provided docker images are mostly based on Ubuntu 18.04/Debian Buster (default) or Ubuntu 20.04 (experimental). So, in order to test your application on the same OS as the running environment, you need to prepare and maintain Ubuntu 16.04 based custom images for CI. This is becoming a burden in development.

I'd much appreciate if Ubuntu 20.04 based images could be provided before 16.04 is considered completely obsolete. I'm eager to test and submit feedback when beta versions are ready.

Footnotes

  1. For the record, it will keep receiving security updates for the next three years until April 2024 through the Extended Security Maintenance period. (Less than 6 months to Ubuntu 16.04 ESM: 6 things to prepare)

libvips Preinstalled on Base Image

Now that libvips is the default image processor for Rails is there a way to have that on the base image like Imagemagick? As it stands now, a stock Rails app won't run fully on GAE.

Of course we can reconfigure the app to use ImageMagick still. But given the security, performance and memory issues that library has, it would be nice to take advantage of a better setup.

I attempted to add libvips42 to runtime_config.packages in the app.yaml file. This did succeed in installing libvips but unfortunately the base image on GCP is so old (Ubuntu 16.04) the version of libvips installed is too old for Rails to use. There is another ticket discussing updating the base image to something more modern with a timeline given of 2nd qtr 2021 but obviously that didn't happen.

For now I'm reverting back to ImageMagick but wanted to inquire about libvips.

Can't use env variables defined in Cloud build

Trying to run a Cloud Build file like the next:

steps:
  - name: 'gcr.io/google-appengine/exec-wrapper'
    id: TEST
    args:
      [
        '-i',
        'gcr.io/$PROJECT_ID/${_BUILD_TARGET}',
        '-s',
        '${_CLOUD_SQL_DEV}',
        '-e',
        'DJANGO_SETTINGS_MODULE=$$DJANGO_SETTINGS_MODULE',
        '-e',
        'CLOUD_SQL=/cloudsql/${_CLOUD_SQL_DEV}',
        '--',
       'python',
        'manage.py',
        'migrate',
        '--no-input',
      ]
    env:
      - 'DJANGO_SETTINGS_MODULE=test.production'

Is throwing an error, as it is assigning the env variable in app engine as the string "$DJANGO_SETTINGS_MODULE" instead of the real value that was coming from the env variable.

Step #0 - "apply migrations": ModuleNotFoundError: No module named '$DJANGO_SETTINGS_MODULE' Finished Step #0 - "apply migrations"

Not sure if the problem is in

ENV_PARAMS+=(-e "$OPTARG")
as it is adding the environment variables in quotes ENV_PARAMS+=(-e "$OPTARG"). Maybe removing the quotes would fix the issue

ENV_PARAMS+=(-e $OPTARG)

or the problem can also be in

ENV_PARAMS+=(-e "$OPTARG")
as it is adding the ENV_PARAMS using quotes. Maybe removing the quotes would fix the issue

docker run --rm ${ENTRYPOINT} --volumes-from=${CONTAINER} --network=${CONTAINER_NETWORK} ${ENV_PARAMS[@]} ${IMAGE} "$@"

It is a silly example, as I can use a substituion instead of an env variable there, but what I'm really trying to do is something like https://cloud.google.com/build/docs/securing-builds/use-secrets

No Ruby or Bundler preinstalled?

The README says the ruby-base image is supposed to include a preinstalled Ruby and bundler, but I'm not seeing it? Using your sample Dockerfile:

$ docker build -t ruby-app .
Sending build context to Docker daemon  312.3kB
Step 1/6 : FROM l.gcr.io/google/ruby:latest
 ---> a580171402ff
Step 2/5 : COPY . /app/
 ---> 422b77f40231
Step 3/5 : RUN bundle install && rbenv rehash
 ---> Running in e89277ad445d
/bin/sh: 1: bundle: not found
$ docker run --rm -it 422b77f40231 bash
root@03cf98a682a8:/app# rbenv versions
Warning: no Ruby detected on the system
root@03cf98a682a8:/app# bundle 
bash: bundle: command not found

Am I missing something? I note that the Bookshelf example also installs Ruby and Bundler by hand:
https://cloud.google.com/ruby/tutorials/bookshelf-on-kubernetes-engine#containerizing_the_application

app server crashing after bundle

I'm not sure this is a Dockerfile issue, so if not feel free to close this, but when I deploy on app engine flex my webserver is crashing with the following error:

RuntimeError: Unable to find a spec satisfying rspec-rails (>= 3.5.2) in the set. Perhaps the lockfile is corrupted?

rspec-rails is only configured in development/test groups in the Gemfile and RAILS_ENV and RACK_ENV are both set to staging so the application should not be looking for rspec-rails.

Is it possible it's the way the Dockerfile is doing the bundle or no?

`assets:precompile` fails to run when using webpacker exclusively

Most Rails apps require rails assets:precompile to be run during the build process in order to build the client-side code. It appears this can be accomplished via the build list given in the app.yaml file. Since it's such a common need it appears if no build list is specified there are some heuristics to detect if an application may be a Rails app and if so a fallback build command to build these assets is automatically run.

Unfortunately it appears these heuristics are slightly dated. Rails now includes two options for building client-side assets. The older asset pipeline and the newer webpacker which wraps the webpack tool. Developers may choose to use one, the other or both. Regardless of this choice assets:precompile is still the command to build the assets.

The heuristics in this repo are to just detect the older asset pipeline by looking for the app/assets directory. If a developer is not using the asset pipeline but just using webpacker that directory may not exist and therefore assets:precompile will not be run.

This can obviously be worked around by just providing an explicit build command. But given that webpacker is "the new way" it seems GCP would best served by working out of the box with the new way.

A similar heuristic could be used of looking for the app/javascripts directory. This is the directory webpacker is setup to work with. This is just the default and it can be specified as a different directory. For example a lot of developers name it frontend since it holds more than just JavaScript. But perhaps looking for the default directory is sufficient as a fallback heuristic and people using a non-standard directory can explicitly configure their build list.


Side note. You are calling rake assets:precompile which is also a legacy calling convention. rails assets:precompile is the calling convention for any supported version of Rails (or really anything 5+). Maybe you prefer to use the old calling convention for folks running unsupported versions of Rails? But just figured I would mention it.

secretEnv not working correctly

using this statement in cloudbuild.yaml i got $POSTGRES_PASSWORD as value of env variable POSTGRES_PASSWORD

- name: gcr.io/google-appengine/exec-wrapper
    args:
      - '-i'
      - '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
      - '-s'
      - '${PROJECT_ID}:${_DEPLOY_REGION}:${_DB_INSTANCE}'
      - '-e'
      - 'POSTGRES_HOST=${_POSTGRES_HOST}'
      - '-e'
      - 'POSTGRES_PASSWORD=$$POSTGRES_PASSWORD'
      - '--'
      - 'python'
      - 'manage.py'
      - 'migrate'
    id: Migrate
    secretEnv: ['POSTGRES_PASSWORD']

but using this statement everything work correctly

- name: gcr.io/google-appengine/exec-wrapper
    entrypoint: bash
    args: ['-c', "/buildstep/execute.sh -i $_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA -s ${PROJECT_ID}:${_DEPLOY_REGION}:${_DB_INSTANCE} -e POSTGRES_HOST=${_POSTGRES_HOST} -e POSTGRES_PASSWORD=$$POSTGRES_PASSWORD -- python manage.py migrate"]
    id: Migrate
    secretEnv: ['POSTGRES_PASSWORD']

Standard Env: Could not find nokogiri-1.10.4 in any of the sources

Suddenly from today on deploy I started getting this error.

runtime: ruby25
service: web
entrypoint: bin/rails server
instance_class: F4
automatic_scaling:
  max_instances: 2
  max_idle_instances: 2
  target_cpu_utilization: 0.8

handlers:
  - url: /assets
    static_dir: public/assets
    secure: always

...

  - url: /.*
    script: auto
    secure: always
2019-12-11 18:05:14 web[20191211t175830]  /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find nokogiri-1.10.4 in any of the sources (Bundler::GemNotFound)
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:81:in `map!'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:81:in `materialize'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/definition.rb:170:in `specs'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/definition.rb:237:in `specs_for'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/definition.rb:226:in `requested_specs'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:108:in `block in definition_method'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:20:in `setup'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler.rb:107:in `setup'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.0.2/lib/bundler/setup.rb:20:in `<top (required)>'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2019-12-11 18:05:14 web[20191211t175830]        from /opt/ruby/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2019-12-11 18:05:14 web[20191211t175830]        from /srv/config/boot.rb:3:in `<top (required)>'
2019-12-11 18:05:14 web[20191211t175830]        from bin/rails:8:in `require_relative'
2019-12-11 18:05:14 web[20191211t175830]        from bin/rails:8:in `<main>'

Handle applications that have already vendored their bundle or set a local bundle config

Received a customer report that a deployed application could not load its bundled gems. Bundler appeared to succeed in installing the gems, but the application could not find them during Bundler.require. This is not certain, but it is possible this was because vestiges of an earlier local vendored bundle (e.g. vendor/bundle and/or .bundle directories) were present in the application directory prior to deployment.

We should investigate what happens in such a case, and make sure the runtime handles it. In particular:

  • If there is a vendored bundle installation already
  • If such an installation is in a nonstandard location (and thus might not get copied over with the app during the docker build)
  • If there are important bundler settings in a local bundler config that need to be preserved

Read me and explanations

Hi,

I'm trying to put my ruby project on the app engine, but I'm struggling a lot with the configuration and don't know how to troubleshoot / debug the issue.
I actually created a Stackoverflow post with the explanation of the problem.
https://stackoverflow.com/questions/51233614/google-cloud-ruby-deployment-and-ruby-docker

Would it be possible to have a little run down on how to use the tools that you guys are providing in this repo?

I'm not an expert with docker (Yet!) and a little clarity on how to use the different tools would be very useful for me and I'm sure for other people in my situation.

Thank you very much for your awesome work!

Support configuring the environments omitted from bundle install

because of ruby-generate-dockerfile/app/Dockerfile.erb lines 159 and 161, ruby projects (in my case in the Google App Engine flexible environment) may not deploy using environment names test or development.

although there's a convention to use development locally, I like to use local as the name of my local environment and tried to use development as the name of a deployed environment. however I was stuck with a 502: Bad Gateway status because my dependencies aren't installed when the env is development.

i think this docker file either shouldn't make assumptions about environment names, or should make those assumptions known and allow for some kind of configuration (on App Engine it could be some optional settings in app.yaml)

-

Disregard. Closing.

Stop docker build when asset precompile failed

Just want to find out how we can stop the docker build process when rake assets:precompile raise error.

During our GCP deploy, we found that some of the assets were missing, and after a while of digging, I found that it is because it failed during rake assets:precompile. However, when we check the cloud build, it said it is passed. Here is the log:

Step #1: Webpacker is installed ? ?
Step #1: Using /app/config/webpacker.yml file for setting up webpack paths
Step #1: Compiling?
Step #1: Compilation failed:
Step #1: 
Step #1: Hash: c54203bdd559d84de538
Step #1: Version: webpack 3.11.0
Step #1: Time: 6876ms
Step #1:                                                            Asset       Size  Chunks             Chunk Names
Step #1: components/ExternalLink/ExternalLink-63821095eaa9fcaedff1.js.map      13 kB       2  [emitted]  components/ExternalLink/ExternalLink
Step #1:                              application-190b6bceddbacc646e07.js     129 kB       0  [emitted]  application
Step #1:     components/ExternalLink/ExternalLink-63821095eaa9fcaedff1.js     9.7 kB       2  [emitted]  components/ExternalLink/ExternalLink
Step #1:                          application-190b6bceddbacc646e07.js.map     176 kB       0  [emitted]  application
Step #1:     components/PageFooter/PageFooter-873a83e3ca03e85fbef5.js.map    14.4 kB       1  [emitted]  components/PageFooter/PageFooter
Step #1:         components/PageFooter/PageFooter-873a83e3ca03e85fbef5.js    11.8 kB       1  [emitted]  components/PageFooter/PageFooter
Step #1:                                                    manifest.json  636 bytes          [emitted]  
Step #1:      components/PageFooter/PageFooter-873a83e3ca03e85fbef5.js.gz     4.4 kB          [emitted]  
Step #1:  components/ExternalLink/ExternalLink-63821095eaa9fcaedff1.js.gz    3.88 kB          [emitted]  
Step #1:                                                 manifest.json.gz  198 bytes          [emitted]  
Step #1:                           application-190b6bceddbacc646e07.js.gz    40.1 kB          [emitted]  
Step #1:   [43] (webpack)/buildin/module.js 517 bytes {0} [built]
Step #1:   [55] ./app/javascript/application.js 291 bytes {0} [built]
Step #1:   [61] (webpack)/buildin/global.js 509 bytes {0} [built]
Step #1:     + 160 hidden modules
Step #1: 
Step #1: ERROR in ./app/javascript/components/PageFooter/PageFooter.spec.jsx
Step #1: Module not found: Error: Can't resolve 'enzyme-to-json' in '/app/app/javascript/components/PageFooter'
Step #1:  @ ./app/javascript/components/PageFooter/PageFooter.spec.jsx 7:20-45
Step #1: 
Step #1: Removing intermediate container 233cafe5fec7
Step #1:  ---> 52de3c4c7fab
Step #1: Step 16/18 : FROM augmented-base
Step #1:  ---> 54ab2f5a772e
Step #1: Step 17/18 : COPY --from=app-build /app/ /app/
Step #1:  ---> 37df282bafca
Step #1: Step 18/18 : CMD exec bundle exec foreman start --formation $FORMATION
Step #1:  ---> Running in a663ead4542d
Step #1: Removing intermediate container a663ead4542d
Step #1:  ---> a9d7f75ae09c
Step #1: Successfully built a9d7f75ae09c

Wondering if it is possible to fail the docker build when asset precompile is failed so that we can pick it up during deployment, not after deployment and switch traffic to the problematic build?

Base image doesn't include "git", so "bundle install" fails on gem pointing to git repositories

Hi guys,

It seems that git is missing from this image but is needed when gems are pointing to git repositories instead of rubygems.

Here is the log:

# docker build -t app .
Sending build context to Docker daemon 61.91 MB
Sending build context to Docker daemon
Step 0 : FROM google/ruby
Pulling repository google/ruby
561ed4e0c354: Download complete
511136ea3c5a: Download complete
541923dd11eb: Download complete
11971b6377ef: Download complete
ca08b2acb51f: Download complete
6f1501421de1: Download complete
da2a0911cf5b: Download complete
e60deb1e205a: Download complete
Status: Downloaded newer image for google/ruby:latest
 ---> 561ed4e0c354
Step 1 : WORKDIR /app
 ---> Running in ec39bc8d73a5
 ---> 18955000751b
Removing intermediate container ec39bc8d73a5
Step 2 : ADD Gemfile /app/Gemfile
 ---> 4cbbfe455479
Removing intermediate container 1d7ffce0c57a
Step 3 : ADD Gemfile.lock /app/Gemfile.lock
 ---> 55f20ca64614
Removing intermediate container abcaea5d681e
Step 4 : RUN /usr/bin/bundle install
 ---> Running in 101384c13605
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/...........
You need to install git to be able to use gems from git repositories. For help
installing git, please refer to GitHub's tutorial at
https://help.github.com/articles/set-up-git
INFO[0108] The command [/usr/bin/bundle install] returned a non-zero code: 11

Any workaround?
I suppose I won't be the only one using Github :-)

Executor for App Engine Flexible Environment stuck..

I can't get the migrate step to work!

It successfully:

...
Step #2 - "Migrate": Pulling image: gcr.io/google-appengine/exec-wrapper
Step #2 - "Migrate": Using default tag: latest
Step #2 - "Migrate": latest: Pulling from google-appengine/exec-wrapper
...
Step #2 - "Migrate": Digest: sha256:xxxx
Step #2 - "Migrate": Status: Downloaded newer image for gcr.io/google-appengine/exec-wrapper:latest
Step #2 - "Migrate": gcr.io/google-appengine/exec-wrapper:latest
Step #2 - "Migrate": 
Step #2 - "Migrate": ---------- INSTALL IMAGE ----------
Step #2 - "Migrate": latest: Pulling from xxx/appengine/default.xxxx
...
Step #2 - "Migrate": Digest: xxx
Step #2 - "Migrate": Status: Downloaded newer image for us.gcr.io/xxx/appengine/default.xxx
Step #2 - "Migrate": us.gcr.io/xxx/appengine/default.xxx
Step #2 - "Migrate": 
Step #2 - "Migrate": ---------- EXECUTE COMMAND ----------
Step #2 - "Migrate": php /workspace/artisan migrate --force

Then it stays stuck at "Execute Command" forever.

Note that I'm not interested in the cloud proxy part. Just being able to run the php artisan migrate --force command on the appengine instance.

What am I doing wrong?

  - id: Deploy
    name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
    entrypoint: 'gcloud'
    args:
      [
        'app',
        'deploy',
        '-q',
        '--promote',
        '-v=$BUILD_ID',
        '--project=$PROJECT_ID'
      ]

  - id: Migrate
    name: 'gcr.io/google-appengine/exec-wrapper'
    entrypoint: 'bash'
    args:
      [
        '/buildstep/execute.sh',
        '-i', 'us.gcr.io/${PROJECT_ID}/appengine/default.${BUILD_ID}:latest',
        '-e', 'APP_KEY=$$APP_KEY',
        '-e', 'DB_CONNECTION=mysql',
        '-e', 'DB_HOST=$$DB_HOST',
        '-e', 'DB_DATABASE=xxx',
        '-e', 'DB_PORT=3306',
        '-e', 'DB_USERNAME=$$DB_USERNAME',
        '-e', 'DB_PASSWORD=$$DB_PASSWORD',
        '--', 'php /workspace/artisan migrate --force'
      ]
    secretEnv: ['APP_KEY', 'DB_HOST', 'DB_USERNAME', 'DB_PASSWORD']
    waitFor:
      - Deploy

Flex runtime fails to run assets:precompile with webpacker

Step #1: Step 13/16 : RUN bundle exec rake assets:precompile || true
Step #1:  ---> Running in f037fe8301c6
Step #1: I, [2022-03-31T06:43:10.904093 #8]  INFO -- : Writing /app/public/assets/manifest-b84bfa46a33d7f0dc4d2e7b8889486c9a957a5e40713d58f54be71b66954a1ff.js
...
Step #1: Compiling...
Step #1: Compilation failed:
Step #1: yarn run v1.22.18
Step #1: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Step #1:
Step #1:
Step #1: warning package.json: No license field
Step #1: error Command "webpack" not found.
Step #1:

Folllowing this guide to start with: https://cloud.google.com/ruby/rails/appengine
But using webpacker gem as seen in this commit: IanVaughan/appengine_example@ad5fb35

`/bin/sh: 1: bundle: not found` on deployment

Deployments to my app are failing with /bin/sh: 1: bundle: not found. It may be related to #161. Deployments were previously working. I'm following the instructions from the docs.

$ bundle exec bin/rails assets:precompile
$ gcloud app deploy --no-promote

I have bumped my app engine gem gem 'appengine', '~> 0.4.6'

And have a fairly simple app.yaml

entrypoint: bundle exec rackup --port $PORT
env: flex
runtime: ruby

automatic_scaling:
  min_num_instances: 1

resources:
  cpu: 1
  memory_gb: 4.0

env_variables:
  SECRET_KEY_BASE: [REDACTED]
  DB_USERNAME: postgres
  DB_PASSWORD: [REDACTED]
  DB_HOST: [REDACTED]
  SENDGRID_API_KEY: [REDACTED]
  REDIS_PROVIDER: redis://[REDACTED]:6379
  REDIS_IP: [REDACTED]
  SCOUT_MONITOR: true
  RAILS_SERVE_STATIC_FILES: true
  RAILS_LOG_TO_STDOUT: true

beta_settings:
  cloud_sql_instances: [REDACTED]

skip_files:
  - .gitignore
  - .git/
  - db/data/shpfiles/
  - ^log/.*
  - tmp/
  - ^(.*/)?.*\.DS_Store$
  - spring/

Any ideas on how I can fix / troubleshoot this?

Cheers Team!

Here is the full output.

Finished in 8.641544s, 40.3863 runs/s, 121.3903 assertions/s.
349 runs, 1049 assertions, 0 failures, 0 errors, 0 skips
INFO: Refreshing access_token
Services to deploy:

descriptor:      [/Users/greg/Code/memair/memair/app.yaml]
source:          [/Users/greg/Code/memair/memair]
target project:  [memair-169313]
target service:  [default]
target version:  [20190201t132151]
target url:      [https://memair-169313.appspot.com]


descriptor:      [/Users/greg/Code/memair/memair/worker.yaml]
source:          [/Users/greg/Code/memair/memair]
target project:  [memair-169313]
target service:  [worker]
target version:  [20190201t132151]
target url:      [https://worker-dot-memair-169313.appspot.com]


Do you want to continue (Y/n)?  
Beginning deployment of service [default]...
INFO: Ignoring file [.DS_Store]: File matches ignore regex.
INFO: Ignoring file [.gitignore]: File matches ignore regex.
INFO: Ignoring file [vendor/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [tmp/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [tmp/2018-11-06T23:00:08-05:00-ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]-memory-1000-times.txt]: File matches ignore regex.
INFO: Ignoring directory [tmp/cache]: Directory matches ignore regex.
INFO: Ignoring directory [tmp/pids]: Directory matches ignore regex.
INFO: Ignoring directory [tmp/sockets]: Directory matches ignore regex.
INFO: Ignoring directory [tmp/tmp]: Directory matches ignore regex.
INFO: Ignoring file [test/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [test/graphql/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [spring/50c4ccb1d8f630979e84c03ba14676d1.pid]: File matches ignore regex.
INFO: Ignoring file [public/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [public/icons/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [log/.keep]: File matches ignore regex.
INFO: Ignoring file [log/development.log]: File matches ignore regex.
INFO: Ignoring file [log/production.log]: File matches ignore regex.
INFO: Ignoring file [log/scout_apm.log]: File matches ignore regex.
INFO: Ignoring file [log/test.log]: File matches ignore regex.
INFO: Ignoring file [lib/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [fixtures/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [db/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [db/data/shpfiles/tz_world_mp_including_territorial_waters.dbf]: File matches ignore regex.
INFO: Ignoring file [db/data/shpfiles/tz_world_mp_including_territorial_waters.prj]: File matches ignore regex.
INFO: Ignoring file [db/data/shpfiles/tz_world_mp_including_territorial_waters.qpj]: File matches ignore regex.
INFO: Ignoring file [db/data/shpfiles/tz_world_mp_including_territorial_waters.shp]: File matches ignore regex.
INFO: Ignoring file [db/data/shpfiles/tz_world_mp_including_territorial_waters.shx]: File matches ignore regex.
INFO: Ignoring file [config/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [app/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [.git/.DS_Store]: File matches ignore regex.
INFO: Ignoring file [.git/COMMIT_EDITMSG]: File matches ignore regex.
INFO: Ignoring file [.git/FETCH_HEAD]: File matches ignore regex.
INFO: Ignoring file [.git/HEAD]: File matches ignore regex.
INFO: Ignoring file [.git/ORIG_HEAD]: File matches ignore regex.
INFO: Ignoring file [.git/config]: File matches ignore regex.
INFO: Ignoring file [.git/description]: File matches ignore regex.
INFO: Ignoring directory [.git/hooks]: Directory matches ignore regex.
INFO: Ignoring file [.git/index]: File matches ignore regex.
INFO: Ignoring directory [.git/info]: Directory matches ignore regex.
INFO: Ignoring directory [.git/logs]: Directory matches ignore regex.
INFO: Ignoring directory [.git/modules]: Directory matches ignore regex.
INFO: Ignoring directory [.git/objects]: Directory matches ignore regex.
INFO: Ignoring file [.git/packed-refs]: File matches ignore regex.
INFO: Ignoring directory [.git/refs]: Directory matches ignore regex.
INFO: Need Dockerfile to be generated for runtime ruby
Building and pushing image for service [default]
INFO: Uploading [/var/folders/ty/kbht113d51q8wr1fvgs3bjmw0000gn/T/tmpqauxN0/src.tgz] to [staging.memair-169313.appspot.com/us.gcr.io/memair-169313/appengine/default.20190201t132151:latest]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x105839d50>]
INFO: Using runtime builder [gs://runtime-builders/ruby-default-builder-20190131151959.yaml]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x10594e790>]
Started cloud build [e627fc05-8f2b-4e60-bd40-30b9b45bd173].
To see logs in the Cloud Console: https://console.cloud.google.com/gcr/builds/e627fc05-8f2b-4e60-bd40-30b9b45bd173?project=108774930670
-------------------------------------------------------------------------------- REMOTE BUILD OUTPUT --------------------------------------------------------------------------------
starting build "e627fc05-8f2b-4e60-bd40-30b9b45bd173"

FETCHSOURCE
Fetching storage object: gs://staging.memair-169313.appspot.com/us.gcr.io/memair-169313/appengine/default.20190201t132151:latest#1549045322060792
Copying gs://staging.memair-169313.appspot.com/us.gcr.io/memair-169313/appengine/default.20190201t132151:latest#1549045322060792...
- [1 files][ 27.8 MiB/ 27.8 MiB]                                                
Operation completed over 1 objects/27.8 MiB.                                     
BUILD
Starting Step #0
Step #0: Pulling image: gcr.io/gcp-runtimes/ruby/ubuntu16/generate-dockerfile@sha256:f8351869e13d4f7826c18c88bb7d4869d883da5834f1815045a21aff22003953
Step #0: sha256:f8351869e13d4f7826c18c88bb7d4869d883da5834f1815045a21aff22003953: Pulling from gcp-runtimes/ruby/ubuntu16/generate-dockerfile
Step #0: 3e8c57e640db: Already exists
Step #0: 5ee163c1bb79: Already exists
Step #0: 3c2cba919283: Already exists
Step #0: f7661a262028: Pulling fs layer
Step #0: 9199c4b37f55: Pulling fs layer
Step #0: 066f5c04727a: Pulling fs layer
Step #0: 12bd71246e4c: Pulling fs layer
Step #0: bdbfcb09e84c: Pulling fs layer
Step #0: ab7356c64428: Pulling fs layer
Step #0: 12bd71246e4c: Waiting
Step #0: bdbfcb09e84c: Waiting
Step #0: ab7356c64428: Waiting
Step #0: 066f5c04727a: Verifying Checksum
Step #0: 066f5c04727a: Download complete
Step #0: 9199c4b37f55: Verifying Checksum
Step #0: 9199c4b37f55: Download complete
Step #0: bdbfcb09e84c: Verifying Checksum
Step #0: bdbfcb09e84c: Download complete
Step #0: 12bd71246e4c: Verifying Checksum
Step #0: 12bd71246e4c: Download complete
Step #0: ab7356c64428: Verifying Checksum
Step #0: ab7356c64428: Download complete
Step #0: f7661a262028: Verifying Checksum
Step #0: f7661a262028: Download complete
Step #0: f7661a262028: Pull complete
Step #0: 9199c4b37f55: Pull complete
Step #0: 066f5c04727a: Pull complete
Step #0: 12bd71246e4c: Pull complete
Step #0: bdbfcb09e84c: Pull complete
Step #0: ab7356c64428: Pull complete
Step #0: Digest: sha256:f8351869e13d4f7826c18c88bb7d4869d883da5834f1815045a21aff22003953
Step #0: Status: Downloaded newer image for gcr.io/gcp-runtimes/ruby/ubuntu16/generate-dockerfile@sha256:f8351869e13d4f7826c18c88bb7d4869d883da5834f1815045a21aff22003953
Step #0: Generated Dockerfile
Step #0: ################################################################################
Step #0: ## This Dockerfile builds a Ruby application for the Google App Engine
Step #0: ## Flexible Environment. It may be modified and used as an App Engine "custom
Step #0: ## runtime", or even ported to a different Docker-based hosting environment.
Step #0: ##
Step #0: ## Generated at: 2019-02-01 18:22:38 UTC
Step #0: ## From configuration: app.yaml
Step #0: ## Project: (unknown)
Step #0: ## Service: default
Step #0: ################################################################################
Step #0: 
Step #0: 
Step #0: ################################################################################
Step #0: ## 1. Augmented base image
Step #0: ## From a specific snapshot of the Ruby base image, installs the application's
Step #0: ## desired version of Ruby and any needed Ubuntu packages. Any software needed
Step #0: ## by both the application's build scripts and the final application runtime
Step #0: ## should be installed here.
Step #0: 
Step #0: FROM gcr.io/gcp-runtimes/ruby/ubuntu16@sha256:cb927ec8bb9b3c253c98483afd2c8a08a068a99740a7274fc685550a5e7f81c1 AS augmented-base
Step #0: 
Step #0: ## If your application needs to install additional Ubuntu packages, do so here.
Step #0: # ARG DEBIAN_FRONTEND=noninteractive
Step #0: # RUN apt-get update -y \
Step #0: #     && apt-get install -y -q package-name another-package-name \
Step #0: #     && apt-get clean \
Step #0: #     && rm -f /var/lib/apt/lists/*_*
Step #0: 
Step #0: ## Specify the version of Ruby to use here. This setting is required.
Step #0: ## If you have a `.ruby-version` file in your application directory and/or a
Step #0: ## Ruby version specification in your Gemfile, they must match this value.
Step #0: ARG ruby_version="2.5.1"
Step #0: 
Step #0: ## Install Ruby 2.5.1 from a prebuilt image. If a prebuilt image
Step #0: ## is not available, use the alternate installation method commented below.
Step #0: COPY --from=gcr.io/gcp-runtimes/ruby/ubuntu16/prebuilt/ruby-2.5.1@sha256:7cefe342ba736c6977dc7a5d457e97c79a858db6cfd6d0a99fab70442850af03 \
Step #0:      /opt/rbenv/versions/${ruby_version} \
Step #0:      /opt/rbenv/versions/${ruby_version}
Step #0: RUN rbenv global ${ruby_version} \
Step #0:     && rbenv rehash \
Step #0:     && (bundle version > /dev/null 2>&1 \
Step #0:          || gem install bundler --version ${DEFAULT_BUNDLER_VERSION}) \
Step #0:     && rbenv rehash
Step #0: ## Alternate installation for Ruby versions that have no prebuilt image.
Step #0: # RUN if [ ! -x ${RBENV_ROOT}/versions/${ruby_version}/bin/ruby ]; \
Step #0: #     then \
Step #0: #       cd ${RBENV_ROOT}/plugins/ruby-build \
Step #0: #         && git pull \
Step #0: #         && rbenv install -s ${ruby_version} \
Step #0: #         && rbenv global ${ruby_version} \
Step #0: #         && rbenv rehash \
Step #0: #         && (bundle version > /dev/null 2>&1 \
Step #0: #           || gem install bundler --version ${DEFAULT_BUNDLER_VERSION}) \
Step #0: #         && rbenv rehash; \
Step #0: #     fi
Step #0: 
Step #0: ## Feel free to install any other software needed by both the build process
Step #0: ## (stage 2 below) and the final application runtime.
Step #0: 
Step #0: ## Set environment variables requested in the app engine configuration.
[REDACTED]
Step #0: 
Step #0: 
Step #0: ################################################################################
Step #0: ## 2. Application build
Step #0: ## From the augmented base image, installs any provided bundle, and runs any
Step #0: ## requested build jobs, such as preparation of JavaScript and CSS assets.
Step #0: ## This stage should prepare the /app directory exactly the way needed to run
Step #0: ## the final application.
Step #0: 
Step #0: FROM augmented-base AS app-build
Step #0: 
Step #0: ## Obtain common build tools, including yarn, gcloud, cloud_sql_proxy,
Step #0: ## and the access_cloud_sql script, from this image.
Step #0: COPY --from=gcr.io/gcp-runtimes/ruby/ubuntu16/build-tools@sha256:1b6ae411cb2fef54a857901ee83b5377c5c1c1fe763d979f3672b0dffbaf0d93 /opt/ /opt/
Step #0: 
Step #0: ## Ensure the above tools are in the PATH
Step #0: ENV PATH /opt/bin:/opt/google-cloud-sdk/bin:/opt/yarn/bin:${PATH}
Step #0: 
Step #0: ## For compatibility with earlier versions of the builder.
Step #0: ## You can delete this if your custom build steps don't depend on older paths
Step #0: ## that include /build_tools.
Step #0: RUN ln -s /opt /build_tools \
Step #0:     && ln -s /opt/bin/cloud_sql_proxy /opt/cloud_sql_proxy \
Step #0:     && ln -s /opt/bin/access_cloud_sql /opt/access_cloud_sql
Step #0: 
Step #0: ## Set gcloud project here if your build scripts need to use gcloud.
Step #0: # RUN gcloud config set project my-project-id
Step #0: 
Step #0: ## Copy the application files.
Step #0: COPY . /app/
Step #0: 
Step #0: ## If your build scripts need access to your application's CloudSQL instances,
Step #0: ## list them here, comma-delimited. This environment variable tells the
Step #0: ## "access_cloud_sql" script which databases to connect to.
Step #0: ## Also, make sure the /cloudsql directory is created because the CloudSQL
Step #0: ## Proxy will open sockets in that directory.
Step #0: ARG BUILD_CLOUDSQL_INSTANCES="memair-169313:us-central1:memair-001"
Step #0: RUN mkdir /cloudsql
Step #0: 
Step #0: ## If your build scripts need credentials for access to cloud resources, you
Step #0: ## may provide an appropriate JSON credentials file and set the
Step #0: ## GOOGLE_APPLICATION_CREDENTIALS path accordingly:
Step #0: # COPY my-build-credentials.json /build_tools/credentials.json
Step #0: # ENV GOOGLE_APPLICATION_CREDENTIALS=/build_tools/credentials.json
Step #0: 
Step #0: ## If the application uses bundler, install the bundle here.
Step #0: RUN bundle install --deployment --without="development test" && rbenv rehash
Step #0: 
Step #0: ## Run application build scripts here.
Step #0: ## Scripts that require access to the application CloudSQL instances should
Step #0: ## run access_cloud_sql first to start the cloud_sql_proxy. e.g.
Step #0: ##   RUN access_cloud_sql && bundle exec rake my_task
Step #0: ## Otherwise, simply run each build script in order in a separate RUN command.
Step #0: RUN access_cloud_sql --lenient && bundle exec rake assets:precompile || true
Step #0: 
Step #0: 
Step #0: ################################################################################
Step #0: ## 3. Application image
Step #0: ## From the augmented base image, installs the application directory built in
Step #0: ## stage 2 above, and sets the entrypoint. This is the final image that is
Step #0: ## executed by Google App Engine.
Step #0: 
Step #0: FROM augmented-base
Step #0: 
Step #0: ## Copy built application from build stage
Step #0: COPY --from=app-build /app/ /app/
Step #0: 
Step #0: ## Command to start application.
Step #0: CMD exec bundle exec rails server -p 8080
Step #0: Generated .dockerignore
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/kaniko-project/executor@sha256:32ed8afc3c808d7159a7c1789d46c2abe95c1cb5b7afdd6867e360f0ed952c13
Step #1: INFO[0000] Downloading base image gcr.io/gcp-runtimes/ruby/ubuntu16/prebuilt/ruby-2.5.1@sha256:7cefe342ba736c6977dc7a5d457e97c79a858db6cfd6d0a99fab70442850af03 
Step #1: INFO[0000] Storing source image from stage gcr.io/gcp-runtimes/ruby/ubuntu16/prebuilt/ruby-2.5.1@sha256:7cefe342ba736c6977dc7a5d457e97c79a858db6cfd6d0a99fab70442850af03 at path /kaniko/stages/gcr.io/gcp-runtimes/ruby/ubuntu16/prebuilt/ruby-2.5.1@sha256:7cefe342ba736c6977dc7a5d457e97c79a858db6cfd6d0a99fab70442850af03 
Step #1: INFO[0004] Downloading base image gcr.io/gcp-runtimes/ruby/ubuntu16/build-tools@sha256:1b6ae411cb2fef54a857901ee83b5377c5c1c1fe763d979f3672b0dffbaf0d93 
Step #1: INFO[0004] Storing source image from stage gcr.io/gcp-runtimes/ruby/ubuntu16/build-tools@sha256:1b6ae411cb2fef54a857901ee83b5377c5c1c1fe763d979f3672b0dffbaf0d93 at path /kaniko/stages/gcr.io/gcp-runtimes/ruby/ubuntu16/build-tools@sha256:1b6ae411cb2fef54a857901ee83b5377c5c1c1fe763d979f3672b0dffbaf0d93 
Step #1: INFO[0007] Downloading base image gcr.io/gcp-runtimes/ruby/ubuntu16@sha256:cb927ec8bb9b3c253c98483afd2c8a08a068a99740a7274fc685550a5e7f81c1 
Step #1: INFO[0007] Unpacking rootfs as cmd RUN rbenv global ${ruby_version}     && rbenv rehash     && (bundle version > /dev/null 2>&1          || gem install bundler --version ${DEFAULT_BUNDLER_VERSION})     && rbenv rehash requires it. 
Step #1: INFO[0025] Taking snapshot of full filesystem...        
Step #1: INFO[0029] Skipping paths under /kaniko, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /root/tokencache, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /builder/cache, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /builder/outputs, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /builder/home, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /var/run, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /sys, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /dev, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /proc, as it is a whitelisted directory 
Step #1: INFO[0029] Skipping paths under /workspace, as it is a whitelisted directory 
Step #1: INFO[0039] ARG ruby_version="2.5.1"                     
Step #1: INFO[0039] COPY --from=gcr.io/gcp-runtimes/ruby/ubuntu16/prebuilt/ruby-2.5.1@sha256:7cefe342ba736c6977dc7a5d457e97c79a858db6cfd6d0a99fab70442850af03      /opt/rbenv/versions/${ruby_version}      /opt/rbenv/versions/${ruby_version} 
Step #1: INFO[0044] RUN rbenv global ${ruby_version}     && rbenv rehash     && (bundle version > /dev/null 2>&1          || gem install bundler --version ${DEFAULT_BUNDLER_VERSION})     && rbenv rehash 
Step #1: INFO[0044] cmd: /bin/sh                                 
Step #1: INFO[0044] args: [-c rbenv global ${ruby_version}     && rbenv rehash     && (bundle version > /dev/null 2>&1          || gem install bundler --version ${DEFAULT_BUNDLER_VERSION})     && rbenv rehash] 
Step #1: Successfully installed bundler-1.16.6
Step #1: 1 gem installed
Step #1: INFO[0045] ENV [REDACTED]
Step #1: INFO[0045] No files changed in this command, skipping snapshotting. 
Step #1: INFO[0045] Storing source image from stage 0 at path /kaniko/stages/0 
Step #1: INFO[0063] Deleting filesystem...                       
Step #1: INFO[0066] Base image from previous stage 0 found, using saved tar at path /kaniko/stages/0 
Step #1: INFO[0067] Unpacking rootfs as cmd RUN ln -s /opt /build_tools     && ln -s /opt/bin/cloud_sql_proxy /opt/cloud_sql_proxy     && ln -s /opt/bin/access_cloud_sql /opt/access_cloud_sql requires it. 
Step #1: INFO[0084] Taking snapshot of full filesystem...        
Step #1: INFO[0088] Skipping paths under /kaniko, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /root/tokencache, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /builder/cache, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /builder/outputs, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /builder/home, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /var/run, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /sys, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /dev, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /proc, as it is a whitelisted directory 
Step #1: INFO[0088] Skipping paths under /workspace, as it is a whitelisted directory 
Step #1: INFO[0100] COPY --from=gcr.io/gcp-runtimes/ruby/ubuntu16/build-tools@sha256:1b6ae411cb2fef54a857901ee83b5377c5c1c1fe763d979f3672b0dffbaf0d93 /opt/ /opt/ 
Step #1: INFO[0104] ENV PATH /opt/bin:/opt/google-cloud-sdk/bin:/opt/yarn/bin:${PATH} 
Step #1: INFO[0104] RUN ln -s /opt /build_tools     && ln -s /opt/bin/cloud_sql_proxy /opt/cloud_sql_proxy     && ln -s /opt/bin/access_cloud_sql /opt/access_cloud_sql 
Step #1: INFO[0104] cmd: /bin/sh                                 
Step #1: INFO[0104] args: [-c ln -s /opt /build_tools     && ln -s /opt/bin/cloud_sql_proxy /opt/cloud_sql_proxy     && ln -s /opt/bin/access_cloud_sql /opt/access_cloud_sql] 
Step #1: INFO[0104] Using files from context: [/workspace]       
Step #1: INFO[0105] COPY . /app/                                 
Step #1: INFO[0105] ARG BUILD_CLOUDSQL_INSTANCES="memair-169313:us-central1:memair-001" 
Step #1: INFO[0105] RUN mkdir /cloudsql                          
Step #1: INFO[0105] cmd: /bin/sh                                 
Step #1: INFO[0105] args: [-c mkdir /cloudsql]                   
Step #1: INFO[0105] RUN bundle install --deployment --without="development test" && rbenv rehash 
Step #1: INFO[0105] cmd: /bin/sh                                 
Step #1: INFO[0105] args: [-c bundle install --deployment --without="development test" && rbenv rehash] 
Step #1: /bin/sh: 1: bundle: not found
Step #1: error building image: error building stage: waiting for process to exit: exit status 127
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/kaniko-project/executor@sha256:32ed8afc3c808d7159a7c1789d46c2abe95c1cb5b7afdd6867e360f0ed952c13" failed: exit status 1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ERROR: (gcloud.app.deploy) Cloud build failed. Check logs at https://console.cloud.google.com/gcr/builds/e627fc05-8f2b-4e60-bd40-30b9b45bd173?project=108774930670 Failure status: UNKNOWN: Error Response: [2] Build failed; check build logs for details

exec-wrapper can't write files into /workspace folder in Cloud Build

Trying to run a Cloud Build file like the next:

steps:
  - name: 'gcr.io/google-appengine/exec-wrapper'
    id: TEST
    args:
      [
        '-i',
        'gcr.io/$PROJECT_ID/${_BUILD_TARGET}',
        '-s',
        '${_CLOUD_SQL_DEV}',
        '-e',
        'DJANGO_SETTINGS_MODULE=${_DJANGO_SETTINGS}',
        '-e',
        'CLOUD_SQL=/cloudsql/${_CLOUD_SQL_DEV}',
        '--',
        'bash',
        '-c',
        'touch /workspace/test.txt',
      ]

Is throwing an error, as it can't write in the /workspace folder:

touch: cannot touch '/workspace/test.txt': Permission denied

It would be great if the workspace directory and/or any other volume defined in the step were mapped directly, but it could also be a good option to accept volumes as parameters with the -v option. Something like

  - name: 'gcr.io/google-appengine/exec-wrapper'
    id: TEST
    args:
      [
        '-i',
        'gcr.io/$PROJECT_ID/${_BUILD_TARGET}',
        '-s',
        '${_CLOUD_SQL_DEV}',
        '-e',
        'DJANGO_SETTINGS_MODULE=${_DJANGO_SETTINGS}',
        '-e',
        'CLOUD_SQL=/cloudsql/${_CLOUD_SQL_DEV}',
        '-v',
        '/workspace:/workspace',
        '--',
        'bash',
        '-c',
        'touch /workspace/test.txt',
      ]

'DEBIAN7' for property vm_image_type is not an allowed choice" error on deploy

I just suddenly got this error this morning when I tried to deploy. I've been deploying successfully for months and this deploy contained a merely cosmetic change to my app so I think this is rather strange.

...
738c23a13a19: Layer already exists
31cb62ec9f95: Layer already exists
0a79470cd5e1: Pushed
dd6426b5d02d: Pushed
latest: digest: sha256:3438c3544a6144ee5890081bc4cab80dfcff9c9242e2573d85c7ac910dc2d2df size: 3460
DONE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Updating service [default] (this may take several minutes)...
.....................failed.
ERROR: (gcloud.app.deploy) Error Response: [13] Unexpected Error. (Value u'DEBIAN7' for property vm_image_type is not an allowed choice)

update: When I re-deployed, I did not experience the error, so this might be something rare/unstable

note: originally posted googleapis/google-cloud-ruby#1869

Ability to skip precompile step?

In our app we precompile assets ourselves (and the Google App Engine Rails tutorials say to do the same). However, when deploying the ruby app to Google App Engine, the Dockerfile also precompiles assets, which is very slow in our build since we also compile an Ember client-side application.

Is it possible to skip the precompile step in the deploy if assets are already being served out of /public?

Update Node to Version Supported By Rails

The stable version of webpacker (Rail's integration with webpack) requires at least Node v10.17.0. This repo builds images that only include 10.16.3.

I was going to create a quick PR as it looks like those are just set in the Rakefile and the build-ruby-runtime-images.sh files but wasn't sure if there was a preference to making the most minimal change that would be compatible (upgrading to 10.17.0) or bump to the most recent stable version of the Node 10 series, 10.22.1. Or maybe even to the bump to the 12 or 14 series since the 10 series is EOL in about 5.5 months from now.

Reuse gems from previous version

I noticed that every time I run gcloud app deploy, bundle install will be execute, and it will refeching gems and install them again, even the ruby version and Gemfile.lock are not updated.

Wondering if there is a way for us to reuse the gems we fetched before, so that it can speed up the deployments.

Support for a Maintained Version of NodeJS

Looks like the containers are still stuck at 16.15.0 from when they were upgraded almost 2 years ago. Seeing as Node v16 has been EOL for about 5 months now, would it be possible to update to a newer version of Node? Looks like v20 is LTS with EOL being on 2026-04-30.

Not only is there the obvious security concern, I'm also having to pin more and more packages to an old version to have something that can still run on GCP.

Cannot use 2 instances in beta_settings cloud_sql_instances

Before today I was able to deploy my app with this setting in app.yaml :

beta_settings:
    cloud_sql_instances: project-dev:us-region1:database-one,project-dev:us-region1:database-two

But today I got this error in docker image build
Illegal cloud sql instance name: "project:region:database_1,project:region:database_2"
Are there any changes in cloud_sql_proxy settings? I used a comma-separated list as recommend from here https://cloud.google.com/sql/docs/postgres/sql-proxy and it worked until today.

Can't figure out how to install additional packages

I'm pretty new at GoogleCloud and I've been trying to figure out how to deploy a ruby instance that requires some extra linux packages to be installed.

I was going through the motion of copying the Dockerfile that gets generated when I noticed this packages attribute that would be exactly what I need but I can't seam to trace it back to the yaml configuration file I provide or find anything in documentation about it.

# Installs additional Debian packages requested.
RUN if test -n "$ADDITIONAL_PACKAGES"; then \
      apt-get install -y -q $ADDITIONAL_PACKAGES; \
    fi

If I try to add a "packages" attribute to the app.yaml I get that it's unexpected.
Is this feature not enabled yet throughout the whole stack?

Thanks for the help!

Support compiling Ruby with jemalloc

The libjemalloc library is being added to the base image in #142

To provide full support for jemalloc, we'd need to do the following:

  • Set RUBY_CONFIGURE_OPTS=--with-jemalloc when installing Ruby with rbenv
  • Provide an alternative set of prebuilt MRI binaries compiled against jemalloc. (We cannot just replace the current set because apps pinned to an older runtime with an older base image would break.)
  • Add a runtime_config entry letting users opt-in to using jemalloc.

`apt-get upgrade` in generated Dockerfile

It looks like the base container runs apt-get upgrade but the generated Dockerfile does not.

Recent OpenSSL advisory had me checking if GAE has us safe. When I ran apt-get update -y && apt-get upgrade -y on a freshly deployed app I see there are a lot of packages out-of-date:

The following packages will be upgraded:
  apt apt-utils base-files binutils binutils-common binutils-x86-64-linux-gnu
  ca-certificates cmake cmake-data curl distro-info-data gir1.2-gdkpixbuf-2.0
  gir1.2-harfbuzz-0.0 gir1.2-poppler-0.18 git git-man gpgv libapt-pkg6.0
  libasn1-8-heimdal libbinutils libctf-nobfd0 libctf0 libcurl3-gnutls libcurl4
  libcurl4-openssl-dev libexpat1 libexpat1-dev libfreetype-dev libfreetype6
  libfreetype6-dev libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin
  libgdk-pixbuf2.0-common libgdk-pixbuf2.0-dev libgmp-dev libgmp10
  libgmpxx4ldbl libgnutls30 libgssapi-krb5-2 libgssapi3-heimdal
  libharfbuzz-dev libharfbuzz-gobject0 libharfbuzz-icu0 libharfbuzz0b
  libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal
  libhx509-5-heimdal libjbig-dev libjbig0 libjpeg-turbo8 libjpeg-turbo8-dev
  libk5crypto3 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libmysqlclient-dev
  libmysqlclient21 libnss3 libpam-modules libpam-modules-bin libpam-runtime
  libpam0g libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev
  libpcre2-posix2 libperl5.30 libpixman-1-0 libpixman-1-dev libpoppler-dev
  libpoppler-glib-dev libpoppler-glib8 libpoppler97 libpq-dev libpq5
  libpython3.8 libpython3.8-dev libpython3.8-minimal libpython3.8-stdlib
  libroken18-heimdal libsqlite3-0 libsqlite3-dev libssl-dev libssl1.1
  libtiff-dev libtiff5 libtiffxx5 libudev1 libwind0-heimdal libxml2
  libxml2-dev libxml2-utils libxslt1-dev libxslt1.1 linux-libc-dev login
  openssl passwd perl perl-base perl-modules-5.30 python3.8 python3.8-dev
  python3.8-minimal tzdata zlib1g zlib1g-dev
109 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.8 MB of archives.
After this operation, 227 kB of additional disk space will be used.

This is re-enforced by the fact that GCP lists the GAE built apps as having many CVEs according to the container registry:

image

In theory we could direct the generate dockerfile to use our own base container which we update more often. But that seems like a lot of effort given that the point of GAE is to remove that sort of maintenance.

If the augmented-base container ran apt-get upgrade -y then every time the app is built and deployed it would get all the latest security updates automatically. Is there a way to make this happen?

env_variables in app.yaml is not available during docker build

I see that env_variables in app.yaml are available to the app running after deployment,
but they are not available during docker build.

If it is not a bug but intended, how can I pass variables to build the docker.
Concretely, bundle exec rake assets:precompile fails since some variables (like DOMAIN_NAME) defined in app.yaml but not visible to the docker build process.

unable to deploy due to persistent rubygems timeout

This started happening today. Every time I try to deploy, I get an error like the following during the gem installation phase:

...
Installing rly 0.2.3
Installing zonefile 1.04
Installing stackdriver-core 0.21.0
Installing libv8 3.16.14.19 (x86_64-linux)
Installing rb-fsevent 0.9.8
Installing netrc 0.11.0
Installing mysql2 0.4.5 with native extensions
Installing puma 3.8.2 with native extensions
Using bundler 1.14.3
Installing redcarpet 3.4.0 with native extensions
Installing ref 2.0.0
Installing rspec-support 3.5.0
Installing rubyzip 1.2.1
Installing sass 3.4.23
Installing tilt 2.0.7
Installing websocket 1.2.4
Installing temple 0.7.7
Installing faker 1.7.3
Installing tzinfo 1.2.2
Installing nokogiri 1.7.1 with native extensions
Installing rack-test 0.6.3
Installing sprockets 3.7.1
Installing websocket-driver 0.6.5 with native extensions
Installing mime-types 3.1
Installing addressable 2.5.0
Installing childprocess 0.6.2
Gem::RemoteFetcher::UnknownHostError: timed out
(https://rubygems.org/gems/coffee-script-source-1.12.2.gem)
An error occurred while installing coffee-script-source (1.12.2), and Bundler
cannot continue.
Make sure that `gem install coffee-script-source -v '1.12.2'` succeeds before
bundling.
The command '/bin/sh -c bundle install && rbenv rehash' returned a non-zero code: 5
ERROR
ERROR: build step "gcr.io/cloud-builders/docker@sha256:fbdb50a2d9d93916ae0193abfd4796f4b580143f60a9406e546906c9bbe768a0" failed: exit status 5
ERROR: (gcloud.app.deploy) Error Response: [2] Build failed; check build logs for details

Every time it happens it is a different gem that times out. At first I was thinking maybe rubygems or google was having network issues, but it fails so consistently that I think maybe something else is wrong. It's been about a month since I deployed, so maybe some change has messed this up?

note: I am using the flexible app engine,

Here is my Dockerfile:

FROM gcr.io/google_appengine/ruby
RUN apt-get update -y && \
    apt-get install -y -q --no-install-recommends \
        libqtwebkit-dev \
        gstreamer1.0-plugins-base \
        gstreamer1.0-tools \
        gstreamer1.0-x
COPY Gemfile Gemfile.lock /app/
RUN bundle install && rbenv rehash
COPY . /app/

Here is my Gemfile:

source 'http://rubygems.org'

gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'activerecord'
gem 'mysql2', '>= 0.3.18', '< 0.5'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7'
gem 'slim-rails'
gem 'google-cloud'
gem 'font-awesome-rails'
gem 'httpclient'
gem 'faraday'
gem 'rest-client'
gem 'github-markup'
gem 'redcarpet'
gem 'gon'
gem 'gibberish'
gem 'therubyracer'
gem 'mailgun_rails'
gem 'faker'
gem 'factory_girl_rails'
gem 'stackdriver'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platform: :mri
  gem 'rspec-rails'
  gem 'rack-test'
  gem 'selenium-webdriver'
  gem 'capybara-webkit'
  gem 'capybara-email'
  gem 'timecop'
  gem 'letter_opener'
  gem 'awesome_print'
  gem 'database_cleaner'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console'
  gem 'listen', '~> 3.0.5'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Here is my gcloud version:

sam:~$ gcloud --version
Google Cloud SDK 147.0.0
alpha 2017.03.13
beta 2017.03.13
bq 2.0.24
bq-nix 2.0.24
core 2017.03.13
core-nix 2017.03.13
gcloud 
gcloud-deps 2017.03.13
gcloud-deps-linux-x86_64 2017.03.13
gsutil 4.22
gsutil-nix 4.22

Here is my Gemfile.lock:
http://pastebin.com/2vm0QFTu

Here is my app.yaml file:

runtime: custom
env: flex
entrypoint: bundle exec rackup -p 8080 -E production config.ru

resources:
  cpu: .5
  memory_gb: 1.3
  disk_size_gb: 10

automatic_scaling:
  min_num_instances: 1
  max_num_instances: 3
  cool_down_period_sec: 60
  cpu_utilization:
    target_utilization: 0.5

@dazuma

moved from: googleapis/google-cloud-ruby#1344 (comment)

ENV output when generating Dockerfile

The ruby-generate-dockerfile container is used by Google App Engine to deploy Ruby/Rails applications. The last thing it does after generating the Dockerfile for the Ruby/Rails application is output the entire generated Dockerfile.

I can see how this step would be helpful in debugging as you could see how the container is being configured. But this means any ENV variables are also outputted to the Cloudbuild log files. Since ENV variables often contain sensitive credentials this seem unwise.

At the most simple level might be a flag that someone can use to indicate if they want the Dockerfile to output for debugging. By default don't output but with a certain flag that can be given to the GAE deploy command (and therefore passed onto this generator) you get the best of both worlds. Secure by default but debugging output can be enabled.

Another option might be filter the values of all ENV variables from the Dockerfile output. This removes the complexity of a config option and 99% of the generated Dockerfile can be seen but the part that might contain sensitive data would just have something like:

Step #7 - "default_service": Step #0: ENV RAILS_ENV="XXXXXXXX" \
Step #7 - "default_service": Step #0:     RAILS_MASTER_KEY="XXXXXXXX" \
Step #7 - "default_service": Step #0:     DATABASE_HOST="XXXXXXXX" \
Step #7 - "default_service": Step #0:     DATABASE_USER="XXXXXXXXX" \
Step #7 - "default_service": Step #0:     DATABASE_PASSWORD="XXXXXXXX"

As you can see this might over-reach some. The RAILS_ENV env variable is not sensitive. But the others become protected.

It just seems a shame that we have nice components like the Secrets Manager to store these secrets securely, CloudBuild can pull these secrets out via the 'avaliableSecrets' so we can pass it onto gcloud app deploy only to have all that effort undone by the stock build process.

Allow Specified Node Version

There was previously as issue where the version of Node bundled with these containers was so old it was incompatible with Rails. Even though that has been resolved, the current version bundled, 14.16.1, is also fairly old (over a year).

Although the 14 series is still supported there have been numerous CVEs on the 14 series and I think we need to be on the latest of that series to address all of them. The impact of these security issues may be considered minor since Node is primarily used to build the JS bundle in Rails but with the JS being so pervasive some apps may be using NodeJS for other purposes. For example our app uses puppetter to do some HTML-to-PDF conversions.

Also it limits the libraries we can use. For example the latest version of eslint does work on the 14 series but does need at least 14.17.x.

Obviously we could build our own custom container but that greatly increases the level of effort. It would be ideal if we could just specify the version like we do with Ruby. I know you guys use rbenv to install the specified Ruby version (using a pre-built if available). Perhaps you could do a similar thing with nodenv which is based on rbenv. Or if you want a single tool perhaps switch both to asdf.

Disable `rake asset:precompile` step if `public/assets` existed

We notice when we run gcloud app deploy, it will trigger rake asset:precompile.

However, we actually follow this document:
https://cloud.google.com/ruby/rails/appengine#deploy_to_app_engine_flexible_environment
to setup our application, so we already run rake asset:precompile in our CI.

Also, I noticed asset:precompile step actually output following logs during gcloud app deploy:

Step #1: Step 14/17 : RUN access_cloud_sql --lenient && bundle exec rake assets:precompile || true
Step #1: ---> Running in 13daff15fea9
Step #1: ERROR: Failed to start cloud_sql_proxy
Step #1: 2018/08/08 21:55:33 errors parsing config:
Step #1: googleapi: Error 403: The client is not authorized to make this request., notAuthorized
Step #1: yarn install v1.7.0
Step #1: [1/5] Validating package.json...
Step #1: [2/5] Resolving packages...
Step #1: [3/5] Fetching packages...
Step #1: info [email protected]: The platform "linux" is incompatible with this module.
Step #1: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
Step #1: warning [email protected]: The engine "ender" appears to be invalid.
Step #1: [4/5] Linking dependencies...
Step #1: warning "@rails/webpacker > [email protected]" has unmet peer dependency "caniuse-lite@^1.0.30000697".
Step #1: warning " > [email protected]" has unmet peer dependency "@types/angular@>=1.5".
Step #1: warning " > [email protected]" has unmet peer dependency "@types/prop-types@>=15".
Step #1: warning " > [email protected]" has unmet peer dependency "@types/react@>=16".
Step #1: warning " > [email protected]" has unmet peer dependency "@types/react-dom@>=16".
Step #1: warning " > [email protected]" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
Step #1: warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
Step #1: [5/5] Building fresh packages...
Step #1: error /app/node_modules/phantomjs: Command failed.
Step #1: Exit code: 1
Step #1: Command: node install.js
Step #1: Arguments: 
Step #1: Directory: /app/node_modules/phantomjs
Step #1: Output:
Step #1: PhantomJS not found on PATH
Step #1: Phantom installation failed TypeError: Path must be a string. Received undefined
Step #1: at assertPath (path.js:28:11)
Step #1: at Object.join (path.js:1236:7)
Step #1: at findSuitableTempDirectory (/app/node_modules/phantomjs/install.js:127:30)
Step #1: at /app/node_modules/phantomjs/install.js:476:19
Step #1: at nextTickCallback (/app/node_modules/kew/kew.js:47:28)
Step #1: at _combinedTickCallback (internal/process/next_tick.js:131:7)
Step #1: at process._tickCallback (internal/process/next_tick.js:180:9) TypeError: Path must be a string. Received undefined
Step #1: at assertPath (path.js:28:11)
Step #1: at Object.join (path.js:1236:7)
Step #1: at findSuitableTempDirectory (/app/node_modules/phantomjs/install.js:127:30)
Step #1: at /app/node_modules/phantomjs/install.js:476:19
Step #1: at nextTickCallback (/app/node_modules/kew/kew.js:47:28)
Step #1: at _combinedTickCallback (internal/process/next_tick.js:131:7)
Step #1: at process._tickCallback (internal/process/next_tick.js:180:9)
Step #1: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Step #1: Webpacker is installed 🎉 🍰
Step #1: Using /app/config/webpacker.yml file for setting up webpack paths
Step #1: Compiling…
Step #1: Compiled all packs in /app/public/packs

So I don't really think the step is working 😂

Base on the reasons above, I was wondering if it is possible that we can somehow disable rake asset:precompile or if it can automatically disable it when public/assets existed(as an indicator for asset:precompile ran already)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.