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

Update Docker file to be multi-platform #6269

Closed
9 tasks
roslynwythe opened this issue Feb 9, 2024 · 10 comments
Closed
9 tasks

Update Docker file to be multi-platform #6269

roslynwythe opened this issue Feb 9, 2024 · 10 comments
Assignees
Labels
Complexity: Medium Draft Issue is still in the process of being created Feature: Docker role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours

Comments

@roslynwythe
Copy link
Member

roslynwythe commented Feb 9, 2024

Overview

We need to update our Docker file to support multiple platforms, in order to resolve a problem experienced by users with mac M1 processors

Action Items

  • Fork the repository ghpages-docker
  • Create an issue branch from the main branch
  • Edit .github/workflows/build-and-push-to-docker-hub.yml workflow and/or Dockerfile to support platforms linux/amd64 and linux/arm64
  • Create a personal dockerhub account
  • Create secrets DOCKER_USERNAME and DOCKER_PASSWORD from the dockerhub account
  • Test the new Docker image hackforlaops/ghpages:latest in your dockerhub account on these platforms
    • Windows 64-bit
    • Mac with Apple M1 or later
  • Submit Pull Request to the ghpages-docker repository

Resources/Instructions

@roslynwythe roslynwythe added Feature Missing This label means that the issue needs to be linked to a precise feature label. size: missing role missing Complexity: Missing labels Feb 9, 2024

This comment was marked as outdated.

@roslynwythe roslynwythe added Draft Issue is still in the process of being created Complexity: Medium size: 1pt Can be done in 4-6 hours role: back end/devOps Tasks for back-end developers Feature: Docker and removed Feature Missing This label means that the issue needs to be linked to a precise feature label. size: missing role missing Complexity: Missing labels Feb 9, 2024
@roslynwythe roslynwythe added Draft Issue is still in the process of being created and removed Draft Issue is still in the process of being created labels Feb 25, 2024
@roslynwythe
Copy link
Member Author

@fyliu could you kindly review this issue? Also would it be appropriate for me to use your https://github.com/hackforla/docker-mkdocs/blob/main/.github/workflows/build-image.yml as a reference?

@fyliu
Copy link
Member

fyliu commented Feb 26, 2024

@roslynwythe Maybe my workflow file could serve as an example?


I have a question: do you know if PRs made from a fork is able to run workflows in the main repo? I'm guessing no, because it feels like a security risk if it did.

I know that PRs from same repo branches are able to run workflows with the repo secrets, so that someone making a PR with the workflow file tagging hackforlaops/ghpages-test6269:latest would cause the repo to build and push that image. It was annoying when someone from my team made an unmerged change in a PR that caused ghpages to build the docs from his branch. The ghpages site should always show the latest merged changes of course. I suspect that's the major reason the website team makes everybody develop on forks.


Anyway, the issue is that dockerhub credentials in github secrets wouldn't replicate over when forking the repo.

What I did was

  • fork the repo
  • create a personal dockerhub account (fyliu)
  • set the credentials in my fork using the same secret names as the one in the upstream repo (DOCKER_USERNAME and DOCKER_PASSWORD from build-and-push-to-docker-hub.yml in your case)

That allowed my fork's workflow to push the images to my personal dockerhub repo for testing. I didn't have to change the image tag since it's a different dockerhub repo.

fyliu/mkdocs repo
hackforlaops/mkdocs repo

This comment was marked as outdated.

@ExperimentsInHonesty
Copy link
Member

This issue will have to have a second developer assigned after the first person does the work, so that they can test it in the environment the other developer does not have. That needs to be mentioned in the instructions.

@roslynwythe
Copy link
Member Author

roslynwythe commented Mar 28, 2024

@ExperimentsInHonesty I updated the Action Items to reflect the advice of @fyliu to have the dev perform testing in their personal dockerhub account. But I'm unclear on what will happen after the dev submits the Pull Request to the ghpages-docker repository. How will a second developer be able to generate and test an image on the hackforla dockerhub prior to merging the PR? And should the second developer be someone who already has write access to the ghpages-docker repo?

@ExperimentsInHonesty
Copy link
Member

ExperimentsInHonesty commented Apr 23, 2024

@roslynwythe I am going to add this to the agenda for this weeks Ops repo meeting and ask their advice.

@ExperimentsInHonesty
Copy link
Member

@roslynwythe The Ops community passed on it and suggested we reach out to engineering. I will add it to their agenda and attend their meeting.

@ExperimentsInHonesty
Copy link
Member

On ops, there is an issue that probably will need to be moved to engineering or combined with this issue https://github.com/hackforla/ops/issues/128

@ExperimentsInHonesty
Copy link
Member

Turns out that new people with an M1 are not reporting problems (@tony1ee). So we are closing as unplanned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium Draft Issue is still in the process of being created Feature: Docker role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours
Projects
Development

No branches or pull requests

3 participants