KEMBAR78
Add dockerfile by pdevine · Pull Request #12 · jmhobbs/terminal-parrot · GitHub
Skip to content

Conversation

pdevine
Copy link

@pdevine pdevine commented Oct 1, 2016

This change adds a makefile and a dockerfile so you can contain the parrot.

@jduss4
Copy link

jduss4 commented Oct 7, 2016

Nothing can contain that much partying!!!

@pdevine
Copy link
Author

pdevine commented Oct 7, 2016

@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! docker run -it --rm pdevine/partyparrot

Dockerfile Outdated
@@ -0,0 +1,5 @@
FROM scratch

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.

Copy link
Owner

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.

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.

Copy link
Author

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

Copy link

@robbyoconnor robbyoconnor Jun 4, 2018

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

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 :)

Copy link
Author

Choose a reason for hiding this comment

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

@robbyoconnor no argument there.

Copy link

@robbyoconnor robbyoconnor left a 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...

@robbyoconnor
Copy link

Also Rebase.

@jmhobbs
Copy link
Owner

jmhobbs commented Jun 4, 2018

Sorry I let this one languish. I'd love to get it tidy'd up and merged in!

@pdevine pdevine changed the title Add makefile and dockerfile Add dockerfile Jun 4, 2018
Copy link

@robbyoconnor robbyoconnor left a 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

Choose a reason for hiding this comment

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

FROM golang as builder

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.

Copy link
Author

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

Copy link
Author

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

Choose a reason for hiding this comment

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

er...GOPATH

Copy link
Author

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.

@jmhobbs
Copy link
Owner

jmhobbs commented Jun 4, 2018

It builds, it runs, I'm merging. We can argue the finer points in another PR if we really want to.

Thanks!

@jmhobbs jmhobbs merged commit 3392d7e into jmhobbs:master Jun 4, 2018
@robbyoconnor
Copy link

Would you be opposed to me making the changes @jmhobbs ?

@jmhobbs
Copy link
Owner

jmhobbs commented Jun 4, 2018

@robbyoconnor PR's accepted! I'm not a docker expert so get in the weeds on what you're changing 😄

@robbyoconnor
Copy link

robbyoconnor commented Jun 4, 2018 via email

@pdevine
Copy link
Author

pdevine commented Jun 5, 2018

I just work there, so.. ¯_(ツ)_/¯

@robbyoconnor
Copy link

robbyoconnor commented Jun 5, 2018 via email

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.

4 participants