-
Notifications
You must be signed in to change notification settings - Fork 94
Add dockerfile #12
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 dockerfile #12
Conversation
|
Nothing can contain that much partying!!! |
|
@jduss4 true, but if there's one thing that's better than a partying parrot, it's a partying parrot on a whale. See for yourself! |
Dockerfile
Outdated
| @@ -0,0 +1,5 @@ | |||
| FROM scratch | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a multistage build and build this inside of Docker entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this should work,
FROM golang AS gobuilder
RUN go get -u github.com/jmhobbs/terminal-parrot
FROM scratch
COPY --from=gobuilder /go/bin/terminal-parrot /terminal-parrot
CMD ["/terminal-parrot"]Though that totally ignores the working dir and gets it from the repo on build. Would also want a dockerignore in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't do go get -- I'd just use the current working directory and build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm chuckling to myself because multistage builds didn't exist when I first submitted the PR. :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the docs I linked -- set the working directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pdevine well they do now and it's not that difficult to handle :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robbyoconnor no argument there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a multistage build and build inside of docker...rather than having to build on the host and copy the binary...
|
Also Rebase. |
|
Sorry I let this one languish. I'd love to get it tidy'd up and merged in! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite correct -- read the docs closer :)
| @@ -0,0 +1,11 @@ | |||
| FROM golang:alpine3.7 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FROM golang as builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: it doesn't matter what image you use as the first stage as it gets blown away later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robbyoconnor I'm very familiar with multistage builds, thanks. :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no reason to pull in all of the golang image in to build this. The alpine image is less than half the size. Even it should go on a diet.
| @@ -0,0 +1,11 @@ | |||
| FROM golang:alpine3.7 | |||
| WORKDIR /project | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
er...GOPATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the concern is here.
|
It builds, it runs, I'm merging. We can argue the finer points in another PR if we really want to. Thanks! |
|
Would you be opposed to me making the changes @jmhobbs ? |
|
@robbyoconnor PR's accepted! I'm not a docker expert so get in the weeds on what you're changing 😄 |
|
I happen to be pretty decent with Docker :)
…On 06/04/2018 07:29 PM, John Hobbs wrote:
@robbyoconnor <https://github.com/robbyoconnor> PR's accepted! I'm not
a docker expert so get in the weeds on what you're changing 😄
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABaMC072ZstXDUxQhGu3DIvXGesVuW_ks5t5cLsgaJpZM4KL1aU>.
|
|
I just work there, so.. ¯_(ツ)_/¯ |
|
Okay -- sorry about that...I really hope I didn't come off rude or
anything...not my intent!
…On 06/04/2018 10:30 PM, Patrick Devine wrote:
I just work there, so.. ¯_(ツ)_/¯
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABaMERRgqefeMqoD6uE_N8Q_m8UXs20ks5t5e0sgaJpZM4KL1aU>.
|
This change adds a makefile and a dockerfile so you can contain the parrot.