Skip to content

Adding Docker support#28

Open
rofc wants to merge 2 commits into
normen:masterfrom
rofc:docker
Open

Adding Docker support#28
rofc wants to merge 2 commits into
normen:masterfrom
rofc:docker

Conversation

@rofc

@rofc rofc commented Dec 15, 2020

Copy link
Copy Markdown

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

normen commented Dec 15, 2020

Copy link
Copy Markdown
Owner

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

rofc commented Dec 16, 2020

Copy link
Copy Markdown
Author

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