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

Switch from docker hub to ghcr.io (github) #2704

Closed
Diman0 opened this issue Mar 16, 2023 · 6 comments · Fixed by #2705
Closed

Switch from docker hub to ghcr.io (github) #2704

Diman0 opened this issue Mar 16, 2023 · 6 comments · Fixed by #2705
Labels
priority/p0 Critical bug without workaround / Must have type/enhancement Enhances existing functionality

Comments

@Diman0
Copy link
Member

Diman0 commented Mar 16, 2023

EDIT:
To switch to the images on ghcr.io.

  1. Stop the containers docker-compose down
  2. Create the file .env in the same folder as docker-compose.yml with the contents:
DOCKER_ORG=ghcr.io/mailu
  1. Start the containers. docker-compose up -d
  2. Check that the images from ghcr.io are used. docker-compose ps

❗ Mailu 2.0 has been released! ❗
It is recommend to switch to Mailu 2.0. Please read https://mailu.io/2.0/releases.html before making the switch.

old post:
https://blog.alexellis.io/docker-is-deleting-open-source-images/
https://news.ycombinator.com/item?id=35166317

Docker has decided to shutdown all 'Free Team organizations'. Mailu also makes use of this. So we have to move to a different registry for the production images. Ghcr.io (github) is already used for everything but the 1.9 images.

To use it, prefix the image path with ghcr.io. E.g.
Instead of docker pull mailu/admin:master
use: docker pull ghcr.io/mailu/admin:master
or for testing images: docker pull ghcr.io/mailu/admin:pr-2703

Tasks that must be done for switching:

  • Modify the CI.yml (github action) to only use ghcri.io. So modify the step for copying images from ghcr.io to docker hub.
  • Update setup (docker-compose.yml template) to use ghcri.io.
  • Update instructions in the documentation to use ghcr.io. At least the section describing how to pull PR images must be modified.

After the switch has been made, we have to decide if we remove all images from docker. This should give a wake up call to people who never visit the website.

@Diman0 Diman0 added priority/p0 Critical bug without workaround / Must have type/enhancement Enhances existing functionality labels Mar 16, 2023
@Diman0 Diman0 pinned this issue Mar 16, 2023
@nextgens
Copy link
Contributor

I think we should pull the images from docker.

@Diman0
Copy link
Member Author

Diman0 commented Mar 16, 2023

I will work on a PR. After the PR has been submitted, reviewed and merged, I will first make the 1.9 images available on ghcr.io before deleting the images in the docker org mailu.

bors bot added a commit that referenced this issue Mar 17, 2023
2705: Switch from docker.io to ghcr.io for deploying images r=mergify[bot] a=Diman0

## What type of PR?

enhancement

## What does this PR do?
As we all know, docker has announced that they will stop with free docker organisations. The Mailu project used this. In about a month, the mailu docker org stops to exist and all images will be deleted.

This PR modifies the CI/CD workflow (github actions) to use ghcr.io as the container registry for deployed images. The images are first build with `-build` appended to the tag. These images are also used in the test step. Only in the deploy phase, are the final tags added (as it should be). This makes sure new images are only available after the deployment step.

The setup utility is updated to use `ghcr.io/mailu` as the docker_org.

All references to the docker org `mailu` have been replaced with `ghcr.io/mailu` in the documentation.

I confirmed via my Mailu_Fork repo that the github workflow works fine. 
https://github.com/Diman0/Mailu_Fork/actions/runs/4440118095

### Related issue(s)
- closes #2704 

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [x] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Dimitri Huisman <diman@huisman.xyz>
@bors bors bot closed this as completed in 1d36005 Mar 17, 2023
@radoslav-stefanov
Copy link

I will work on a PR. After the PR has been submitted, reviewed and merged, I will first make the 1.9 images available on ghcr.io before deleting the images in the docker org mailu.

I need to migrate one installation to a new box and I am not able to pull 1.9 from anywhere. I guess for now I can try copying existing images from a working server or push them somewhere.

Did you guys manage to add 1.9 images to ghcr?

@nextgens
Copy link
Contributor

$ docker pull ghcr.io/mailu/admin:1.9
1.9: Pulling from mailu/admin
cfab2db72209: Already exists 
63b4f274b36b: Downloading  23.27kB/2.316MB
25d22240b812: Downloading  326.8kB/31.77MB
18bd49581c3c: Download complete 
2a4310c28b59: Waiting 
28eb761abe90: Waiting 
f189367b7eb5: Waiting 
df72642e9ce1: Waiting 
242b3dbc5c07: Waiting 
953e528a7c8a: Waiting 
12c4e5c8b3f0: Waiting 
f94cfefb5974: Waiting 
192e50d4a3ee: Pulling fs layer 

@radoslav-stefanov
Copy link

Weird, I was not able to pull them with just DOCKER_ORG passed. I'll check more.

Thanks @nextgens!

@ghostwheel42 ghostwheel42 unpinned this issue Jun 23, 2023
@ghostwheel42 ghostwheel42 pinned this issue Jun 23, 2023
justin-p added a commit to justin-p/ansible-role-mailu that referenced this issue Aug 15, 2023
@seisdr
Copy link

seisdr commented May 8, 2024

This does nothing

DOCKER_ORG=ghcr.io/mailu

Changing it manually also does nothing
Documentation are clearly out of date and I've spend more than 12 hours trying to configure traefik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/p0 Critical bug without workaround / Must have type/enhancement Enhances existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants