whatscli icon indicating copy to clipboard operation
whatscli copied to clipboard

Adding Docker support

Open rofc opened this issue 5 years ago • 2 comments

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

rofc avatar Dec 15 '20 13:12 rofc

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?

normen avatar Dec 15 '20 16:12 normen

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.

rofc avatar Dec 16 '20 12:12 rofc