pigpio icon indicating copy to clipboard operation
pigpio copied to clipboard

add docker image and github actions autobuild

Open jdrouet opened this issue 5 years ago • 2 comments

Create a docker image for pigpiod and pushes it to the hub when done on master. You need to put your username and password in the secrets to be able to push to docker hub. An image is actually building on my fork for arm32v7 and arm64v8.

jdrouet avatar Nov 29 '19 22:11 jdrouet

@jdrouet , First, thanks for your interest in this project. However, I need your help in understanding how this is used.

I think I understand the goal of this PR is have the pigpio binaries contained in a docker image that one can download and run on their personal raspberry pi. Further, this 'github workflow' will keep those bits up to date with the latest changes - although I think it should only be triggered by a 'push' to the master branch.

Some of my confusion is around the credentials and account that is associated with the workflow. How are the credentials protected if they are hosted on this public repo? I assume the credentials must be available on this repo in order for the workflow to run automatically. If not, are you expecting that each time a push is made, the maintainers of this repo must login to the docker hub with their private account?

I probably have more questions but for now help me understand this much.

guymcswain avatar May 01 '20 18:05 guymcswain

Sorry for my (really) late reply.

First, for it to push to the docker hub, the repo owner should create a docker hub account (it's free), create a token and add it as a secret int the github repository settings. Don't worry, those credentials are only injected as am environment variable on the branch on this repo. If I do a PR and do echo $DOCKER_PASSWORD, I won't be able to seen anything.

The thing to know is that github gives free credits for open source projects, so it will take from the owner's open source credit.

And you're right, we should limit what is being run. We should probably build an image for each PR without pushing it to be sure that it builds and when the branch is master, push it to the docker hub. 🤷‍♂️

jdrouet avatar Oct 07 '20 13:10 jdrouet