Skip to content
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

Dockerfile improvements and automatic Github Actions builds #14

Merged
merged 9 commits into from
Dec 13, 2023

Conversation

sethforprivacy
Copy link
Contributor

This improves the Dockerfile slightly while adding automatic builds via Github Actions to allow you to easily distribute pre-built images.

If that is not something you want, please let me know and I will close this PR and maintain images on my own!

If you do want that, you will need to setup a Docker Hub account (if you wish) or just rely on Github Container Registry. If you want to use Docker Hub, simply create an account, create a Personal Access Token, and add it to the Action Secrets in your repo with the variables DOCKER_USERNAME and DOCKER_PASSWORD.

Once added, whenever you push to main/master Github will automatically build and push under the latest tag and a tag made of the short SHA of the latest commit (i.e. here).

If no changes are made, it will also automatically rebuild and push the images weekly to keep the base image up to date with security patches etc.

@benjamin-wilson
Copy link
Owner

@sethforprivacy looks like there's something wrong with the build
buildx failed with: ERROR: invalid tag "/public-pool:latest": invalid reference format

@sethforprivacy
Copy link
Contributor Author

@sethforprivacy looks like there's something wrong with the build buildx failed with: ERROR: invalid tag "/public-pool:latest": invalid reference format

Ah, that is just failing as it relies on pulling the image from GHCR or Docker Hub, neither of which have the image available from your repo yet.

The important test succeeded, and the vuln scan will succeed after you've pushed an initial image manually or via these Actions.

@benjamin-wilson benjamin-wilson merged commit 8f6eeab into benjamin-wilson:master Dec 13, 2023
1 of 2 checks passed
@sethforprivacy
Copy link
Contributor Author

Well that was fast 😄

Let me know if you run into any issues with the builds, happy to help troubleshoot and you know how to reach me directly!

@sethforprivacy
Copy link
Contributor Author

sethforprivacy commented Dec 13, 2023

unauthorized: incorrect username or password

https://github.com/benjamin-wilson/public-pool/actions/runs/7189355826

Looks like the Docker creds need to be added/updated for it to run (or you can strip out the Docker Hub login + lines pushing to it in the buildx steps)

@benjamin-wilson
Copy link
Owner

benjamin-wilson commented Dec 13, 2023

🤔 I added them to the repo secrets and the access token as the password, should they go in the environment instead?

@sethforprivacy
Copy link
Contributor Author

Should be here:

image

@sethforprivacy
Copy link
Contributor Author

If there it's possible you haven't scoped the access token properly, or you haven't created the repo in Docker Hub (forgot that you have to do that manually!)

@benjamin-wilson
Copy link
Owner

Yeah that's what I did 🤔🤔

@benjamin-wilson
Copy link
Owner

Oh gotta create the repo!

@sethforprivacy
Copy link
Contributor Author

Oh gotta create the repo!

Yeah, that's my bad! Totally forgot that it won't automatically create it for you -.-

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