Skip to content

Adding Docker support #28

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Adding Docker support #28

wants to merge 2 commits into from

Conversation

rofc
Copy link

@rofc rofc commented Dec 15, 2020

Just in case you don't want to install Golang to build the package/binary or, just like me, you like to run apps from containers here is a very simple Dockerfile.

You will need to:

  1. Checkout the code
  2. Build the image, docker buitd -t IMAGE_NAME .
  3. Run the container, docker run --rm -ti IMAGE_NAME

@normen
Copy link
Owner

normen commented Dec 15, 2020

This looks nice, thanks. I don't have much experience with docker but can't the image build check out the compiler and source automatically and delete it afterwards? For just creating an image containing golang and whatscli it seems a bit pointless to add this?

@rofc
Copy link
Author

rofc commented Dec 16, 2020

This looks nice, thanks. I don't have much experience with docker but can't the image build check out the compiler and source automatically and delete it afterwards? For just creating an image containing golang and whatscli it seems a bit pointless to add this?

Here you have a multi-stage dockerfile. make build is executed on golang stage and then the binary is copied into alpine stage.
Steps were not modified.

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.

2 participants