Keep local Docker images up to date
- Dominant language
- JavaScript
- Stars
- 363
- Forks
- 872
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 18
Description
### Dependency
- #5897 when the bot is working again, review issue to see what we need to do.
### Overview
As a member of the website development team, I want to make sure my local Docker environment always matches the GitHub Pages environment. This issue is to create a procedure for developers to periodically update their local Docker images.
### Action Items
- [x] Review the background notes below to understand the reason Docker images need to be updated locally
- [x] Develop a procedure that will result in Docker images being updated regularly
- [x] Possible solution: add instructions in the [How to Contribute wiki](https://github.com/hackforla/website/blob/gh-pages/CONTRIBUTING.md#how-to-contribute-to-hack-for-la), potentially in section [2.7 Working on an issue](https://github.com/hackforla/website/blob/gh-pages/CONTRIBUTING.md#27-working-on-an-issue), about how to delete the locally-stored image and pull the latest version.
- [x] Alternative: research the possibility of automating this process by modifying the `docker-compose.yml` file, or adding additional flags to the `docker compose up` command developers are instructed to use.
### Resources/Instructions
- [How to Contribute wiki](https://github.com/hackforla/website/blob/gh-pages/CONTRIBUTING.md#how-to-contribute-to-hack-for-la)
- [Working on an issue wiki section](https://github.com/hackforla/website/blob/gh-pages/CONTRIBUTING.md#27-working-on-an-issue)
- [docker compose pull documentation](https://docs.docker.com/engine/reference/commandline/compose_pull/)
- [docker rmi documentation](https://docs.docker.com/engine/reference/commandline/rmi/)
- [Docker desktop/dashboard documentation](https://docs.docker.com/desktop/)
- Details about a bot HfLA created re this project https://github.com/hackforla/ops/wiki/@danielridgebot-Ops-Wiki
**Notes on local Docker images**
Although the Docker image the website team uses (`hackforlaops/ghpages`) is updated every time GitHub Pages updates its software dependencies, the newly-updated image is not automatically downloaded to a developer's local computer every time they run `docker compose up`. Instead, Docker will look to see if the image already exists locally and, if it does, will continue to use that version. This may mean that whichever version of the image existed when a developer first ran Docker is the one they are still using, even if new versions have since been published.
The most straightforward way of addressing this is for developers to periodically remove their local copy of the image, either via command line or through the Docker Dashboard GUI, before running `docker compose up`. This will force Docker to automatically download the latest version from [Docker Hub](https://hub.docker.com/r/hackforlaops/ghpages/tags).
A possible solution would be to make removing the image a new step in another workflow that developers regularly use, such as creating a local feature branch to work on an issue, or updating their local `gh-pages` before pushing a finished issue to their forked repo.
Contributor guide
Assessment
This issue has not been assessed yet.