Repository navigation
Conversation
…n#1773) Signed-off-by: Yash Kaushik <yash005kaushik@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1773.
Problem
Applications utilizing generated Docker recipes (e.g. Laravel / PHP requiring PostgreSQL client
pg_dumpforspatie/laravel-backup, ImageMagick, or CLI utilities) run as an unprivileged user (e.g.,www-dataorrails) at runtime. System packages installed during the builder or asset stages are not retained in the final runtime container image, and containers lack root privileges at startup to install system packages on boot.Solution
Added support for an optional
runtimeInstallCommandin generated builds:packages/adapters:runtimeInstallCommand?: stringtoBuildConfig.docker-recipes/php.ts: ExecutesRUN <runtimeInstallCommand>as root after PHP extension installation and prior to copying the application code and dropping privileges towww-data.docker-recipes/ruby.ts&generic.ts: ExecutesRUN <runtimeInstallCommand>in the runtime stage prior to switching to non-root users.docker-recipes/cache.ts: IncludedruntimeInstallCommandin build cache key calculation.packages/contracts: AddedruntimeInstallCommandtoCreateProjectBody(and transitivelyUpdateProjectBody) andMonorepoSubAppFieldsSchema.packages/db: AddedruntimeInstallCommandtext column to theprojecttable with migration0241_runtime_install_command.sql.packages/platform: PersistedruntimeInstallCommandincreateProjectandupdateProject, included it in deployment build snapshots, and passed it tocreateBuildConfig.apps/dashboard: AddedruntimeInstallCommandto project option types and application settings form.