cachet icon indicating copy to clipboard operation
cachet copied to clipboard

Update docker

Open sayem314 opened this issue 1 year ago • 16 comments

v2.4.0 is missing in docker image

sayem314 avatar Oct 30 '23 07:10 sayem314

Any update? @jbrooksuk

sayem314 avatar Jan 29 '24 20:01 sayem314

Is there any way we can help this moving along? I am happy to contribute a github release workflow.

danimo avatar Feb 16 '24 14:02 danimo

Sorry folks! I've not actually done the Cachet Docker release before. @djdefi did all of that.

If we can get a GitHub workflow going, that'd be great.

jbrooksuk avatar Feb 26 '24 14:02 jbrooksuk

Hey @jbrooksuk nice to hear from you!

I used to use this script https://github.com/cachethq/Docker/blob/main/release-helper.sh -- Most of this could be automated in GitHub Actions like https://github.com/docker/build-push-action today instead of doing it via that manual script.

On a new release of Cachet, it comes down to bumping the version here: https://github.com/cachethq/Docker/blob/e88a87d7a6cd29df8d6d1fb6f05de8678bab1782/Dockerfile#L9 and then creating the relevant GitHub tags/release and pushing the image to Dockerhub etc.

It looks like we have the updates to the Dockerfile and such already in place on main, but I think I lost access to the project before being able to create the relevant tag/release for 2.4.0

Building and running it manually from main should work in the interim.

djdefi avatar Feb 26 '24 19:02 djdefi

See https://github.com/cachethq/Docker/pull/426 for an initial version. Adding support for Docker Hub should be as easy as

      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }} 
          password: ${{ secrets.DOCKERHUB_TOKEN }}

And then publish the docker image like the PR does with GHCR. I skipped that mostly because I cannot publish to docker Hub (well, I could setup my own org there, but for now, GHCR was good enough).

Does that help?

danimo avatar Feb 26 '24 21:02 danimo

I've done some cleanups, actions are still on a deprecated nodejs version, but that seems to be something they need to fix on their own.

danimo avatar Feb 27 '24 11:02 danimo

@djdefi good to hear from you too. Thank you for clarifying the process. I'm not a big Docker guy, so I don't know much of it,

@danimo that's awesome! Thank you so much. I guess I need to replace the docker/login-action in the PR to the one you provided?

      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }} 
          password: ${{ secrets.DOCKERHUB_TOKEN }}

jbrooksuk avatar Feb 27 '24 12:02 jbrooksuk

Please never reveal plaintext secrets in commits. https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions explains how Github Action Secrets work.

danimo avatar Feb 27 '24 13:02 danimo

One more hint: To try out Docker Actions without polluting the main project with error messages protentially confusing to others, it's best to fork the project into your personal space, try to make Secrets work there and then create a PR with the result.

Also know that the reason why GHCR.io just works is because its token is implied in GitHub Action's default environment (via secrets.GITHUB_TOKEN). So for external registries, you need to employ the help of GH secrets.

danimo avatar Feb 27 '24 14:02 danimo

@danimo I've already configured GitHub Actions Secrets for the repository now 👍🏻

jbrooksuk avatar Feb 27 '24 14:02 jbrooksuk

I took a look, REGISTRY: ghcr.io still looks wrong, assuming you only want to push to Docker Hub, see the metadata-action part. See https://github.com/docker/metadata-action for reference.

danimo avatar Feb 28 '24 11:02 danimo

Would love to see an official built one, the current DockerFile etc provided doesn't work for us anymore. I guess some of the dependeicies from php7 or other are no longer available

ERROR: failed to solve: process "/bin/sh -c apk add --no-cache --update mysql-client php7 php7-apcu php7-bcmath php7-ctype php7-curl php7-dom php7-fileinfo php7-fpm php7-gd php7-iconv php7-intl php7-json php7-mbstring php7-mcrypt php7-mysqlnd php7-opcache php7-openssl php7-pdo php7-pdo_mysql php7-pdo_pgsql php7-pdo_sqlite php7-phar php7-posix php7-redis php7-session php7-simplexml php7-soap php7-sqlite3 php7-tokenizer php7-xml php7-xmlwriter php7-zip php7-zlib postfix postgresql postgresql-client sqlite sudo wget sqlite git curl bash grep supervisor" did not complete successfully: exit code: 45`

bhavicp avatar Mar 14 '24 06:03 bhavicp

If not official, is there a reliable docker container built by someone else that could be used?

esseti avatar Apr 17 '24 20:04 esseti

I'd love some further help to get Docker automated and up to date. Can anyone help me out here, please? 😊

jbrooksuk avatar Apr 30 '24 13:04 jbrooksuk

I can, what is is that you need exactly? An adjusted workflow that works against the docker registry? The most important part (that only you can contribute) is adding the Docker Hub login credentials as described here and login. After that, simply adjust where the image is pushed to. Ping me if you are stuck.

danimo avatar Apr 30 '24 13:04 danimo

I'd love some further help to get Docker automated and up to date. Can anyone help me out here, please? 😊

What kind of help is needed here? Recreate the Dockerfile?

i tried to build it locally but there are a couple of dependency that do not play well with the alpine version (packages have been remove/moved).

Is there a full list of the requirements and step-by-step instructions? what is in the doc for installation assumes a lot of things on the ability of the user to understand the command and have everything ready on the machine. At least to me.

esseti avatar May 02 '24 07:05 esseti