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

Add initial dockerfile generator #1602

Merged
merged 1 commit into from
Nov 9, 2020
Merged

Conversation

tianon
Copy link
Contributor

@tianon tianon commented Nov 8, 2020

Summary

This adds a very basic implementation of ./script/myapp generate dockerfile - enough to get users started quickly.

Motivation

Docker is a simple and useful way to deploy software, and we might as well help users get started!

References

Closes #1600

(As always, happy to rebase, amend, force push, close, defer, discuss, etc ❤️)

lib/Mojolicious/Guides.pod Outdated Show resolved Hide resolved
lib/Mojolicious/Commands.pm Outdated Show resolved Hide resolved
@tianon tianon force-pushed the dockerfile branch 2 times, most recently from e90330e to 773405c Compare November 9, 2020 04:30
Copy link
Member

@marcusramberg marcusramberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this looks great to me, and I've tested the branch locally to check that it works. Just some minor suggestions for improvement. I guess one other question is about the base image. Will Mojo core be updating the release version as new Perl versions are released? Might it be better to use :latest rather than 5.32?

lib/Mojolicious/Command/Author/generate/dockerfile.pm Outdated Show resolved Hide resolved
Usage: APPLICATION generate dockerfile [OPTIONS]

mojo generate dockerfile

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it might be worth mentioning that generating a Makefile is also required for getting this to work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is not really the place. That's what we will have the cookbook recipe for.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it really becomes a problem for people, we will just add a check in the code for a Makefile.PL or cpanfile and print a warning when generating the Dockerfile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm fine with having it in the cookbook. It was just the first thing that bit me when I generated a helloworld app for testing the generator. (The second was that I used mojo generate for the dockerfile instead of ./script/myapp generate :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've adjusted the examples to use ./script/my_app generate dockerfile consistently, which hopefully is an acceptable first step to help encourage appropriate usage? 😇

t/mojolicious/commands.t Outdated Show resolved Hide resolved
@kraih
Copy link
Member

kraih commented Nov 9, 2020

The default could probably be latest.

@tianon
Copy link
Contributor Author

tianon commented Nov 9, 2020

Really appreciate the reviews! ❤️

I've updated with the suggestions. 👍

Copy link
Member

@kraih kraih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@kraih kraih requested a review from a team November 9, 2020 18:16
@mergify mergify bot merged commit c0b3a06 into mojolicious:master Nov 9, 2020
@tianon tianon deleted the dockerfile branch November 9, 2020 18:58
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

Successfully merging this pull request may close these issues.

Add dockerfile generator
3 participants