Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support adding instructions at the start of the stage #50

Open
nahtnam opened this issue Jan 3, 2024 · 3 comments
Open

Support adding instructions at the start of the stage #50

nahtnam opened this issue Jan 3, 2024 · 3 comments

Comments

@nahtnam
Copy link

nahtnam commented Jan 3, 2024

Use case: I'd like to add certain files before running the build or install.

@rubys
Copy link
Contributor

rubys commented Jan 3, 2024

I have an analogous feature in dockerfile-rails: https://github.com/fly-apps/dockerfile-rails#advanced-customization (`--instructions), which would be relatively straightforward to port to this package.

More precise feedback on where exactly the instructions would be placed would be helpful. You can look at the dockerfile rails template to get an idea of what is implemented there:

  • base is added to the end of the base step
  • build is added just after the COPY . . statement
  • deploy is added just after the COPY --from-build statement (and the rails user is created, which does not currently apply in dockerfile-node).

Would this work for you?

@nahtnam
Copy link
Author

nahtnam commented Jan 4, 2024

Hmm so this use case was copying the .yarn folder (contains plugins) which needs to be copied before the yarn install command. I ended up ejecting because it was a bit too hard to maintain and also we went with Next.js's "standalone mode"

@rubys
Copy link
Contributor

rubys commented Jan 4, 2024

That use case seems common enough that it shouldn't require additional instructions. See this from dockerfile-rails:

https://github.com/fly-apps/dockerfile-rails/blob/b348b6962b928f64803ce0c3260c6eb98f5a8cb0/lib/generators/templates/_npm_install.erb#L3-L5

I assume that you have a .yarnrc? And what directories should be copied from the .yarn directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants