-
Notifications
You must be signed in to change notification settings - Fork 582
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
Generating Dockerfile refers to wrong script name #1905
Comments
Hmm, that's strange; here's the code responsible for that value: mojo/lib/Mojolicious/Command/Author/generate/dockerfile.pm Lines 11 to 12 in 4093223
It's generated either from I guess it maybe needs to use
Or perhaps this is technically a bug in |
The name Is such a solution acceptable, or is the naming for app generation constrained by some need for backward compability? |
The However, the
This ensures that If the second line of the function was changed to
Any ideas over why
|
An alternative might just be to not use a application-name-specific path inside the container. I see |
That seems like a separate (and worthy) consideration to me. The Dockerfile copies the current directory into the container and then executes the script which However, even if it was decided to make the script name generic, it seems to me that the problem described above is still a problem, just one that was now hidden by removal of the known manifestation? Do you agree based my previous post that, unless a reason arises why |
That there is a reason seems probable, given that the tests for
But without a definite reason (such as supporting a certain OS?) it perhaps ought to be changed. If a reason turns up, a comment alongside the code might prevent confusion cropping up again. Edit: Aside from its tests, |
I missed that it isn't just the path but also the script name. |
The first leg of my attempted fix for this in #1918 was rejected because it entails a breaking change. Given that any legitimate fix for this issue would be rejected on the same grounds, is this issue best closed? |
I don't see a rejection, you closed it after one unfavourable review. The real issue here is that we currently lack more reviewers in the project. |
Why does the script name have to be unique at all? To me it's much more important that it's easy to remember and type. |
I'm not so much concerned with the name being unique, as with it being consistent. My PR for #1918 only addresses consistency: ensuring that Once #1918 was merged, it was my intention to verify that the dockerfile generation now works out-of-the-box and is correctly documented. This was the quickest and least controversial route to a fix I could plot. But to respond briefly to your point about uniqueness, I believe there are benefits to the naming of the files (which is based on the class name) being non-ambiguous and reversible. Not least to accommodate automation. I also suspect most developers recall foremost the name of their class, Making the script and configuration file names generic ( |
Ooh, @kraih are you suggesting that having the app generator use (IMO it still makes sense to try and fix the disparity between |
Probably not. But i don't expect them to be 100% unique for every module name variant, like |
I'm happy to concede that point for now, if it helps push this PR through. As mentioned above, the PR #1918 does not alter how the script name is currently formed. |
If you do this:
The following script is created:
But if you generate a Dockerfile using this:
The Dockerfile will refer to a wrongly named
CMD
scriptWORKDIR
path, ref.my_app_something
vs.my_app-something
:The text was updated successfully, but these errors were encountered: