Skip to content

Docker image for ARM64 #2085

Closed
Closed

Description

@vahidshirvani

Which version are you referring to
latest

Problem:
No ARM64 image available on Docker Hub. Only AMD64 is published.

Screenshot 2022-01-13 at 09 16 20

Solution:
This can be solved with Docker Buildx which builds several images for different architectures. So in your case it should be something similar to

docker buildx build --platform linux/arm64,linux/amd64 -t drwetter/testssl.sh:latest . 

Motivation:
Apple Macbook with M1 chip are becoming more prevalent. These machines do not use your typical Intel CPU but are rather ARM based. Apple sees Intel as legacy and as time passes by those machines will be phased out in favour of ARM.


Note: By Intel I mean x86-64 or x64 or x86_64 or AMD64 or Intel 64.
Note: By ARM I mean ARMv8 or ARM64 or AArch64.

Activity

  1. drwetter commented on Jan 13, 2022

    @drwetter
    Collaborator

    Hi @vahidshirvani ,

    the question is whether docker hub supports that, which I can't tell. Do you?

    OT: As of now we can't use the broken openssl 1.0.2. I wasn't able to compile this for M1. This is in general no problem as macOS comes with LibreSSL which we can use as a vehicle for the cases needed.

  2. vahidshirvani commented on Jan 13, 2022

    @vahidshirvani
    Author

    Yes, Docker Hub does support it so you can push multiple architectures. For example see OS/ARCH column for alpine.

    The Docker on MacOS runs inside a Linux Virtual Machine, so what ships with MacOS won't interfere.
    I forgot to mention that once you build and push then this will work on Raspberry Pi 3 and 4 as well as those machines are ARM64 based.

  3. drwetter commented on Jan 14, 2022

    @drwetter
    Collaborator

    We could need a hand here

  4. jauderho commented on Jan 14, 2022

    @jauderho
    Contributor

    @drwetter I do not have a Docker Hub paid account so I do not know if the build process there can support multi-platform builds. BUT the action that I built for you does already push multi-platform to GHCR. Those can be found here: https://github.com/drwetter/testssl.sh/pkgs/container/testssl.sh

    This might be a reason why you want to use GH to build the images then push to both Docker Hub and GHCR as I previously suggested.

    @vahidshirvani You can use the link I shared above or if you must use Docker Hub, I do have images here: https://hub.docker.com/r/jauderho/testssl.sh/tags

  5. drwetter commented on Jan 15, 2022

    @drwetter
    Collaborator

    Ok, thanks.

    Your images stem from GHA pushes or how do you get the platforms in there?

  6. jauderho commented on Jan 16, 2022

    @jauderho
    Contributor
  7. vahidshirvani commented on Apr 4, 2022

    @vahidshirvani
    Author

    Thank you for your answers. I helped me. I will close this issue.

  8. drwetter commented on Apr 4, 2022

    @drwetter
    Collaborator

    I still have headaches (security-wise) hard-wiring access tokens in Github from Docker. There have been issues in the past.

    If anyone can give me a hand how to convince dockerhub to supply other architectures that would be great.

  9. drwetter commented on Sep 21, 2022

    @drwetter
    Collaborator

    I could need a hand here.

    If there's a way w/o hard-wiring access tokens here

  10. tenjaa commented on Nov 15, 2022

    @tenjaa

    The GHCR image already offers an ARM build.
    Why not link it in the readme instead of the dockerhub one?

  11. eins78 commented on Nov 22, 2022

    @eins78

    @drwetter I can confirm that the GHCR version works on ARM, although it offers less/different tags than on Dockerhub)
    I ran it like this: docker run --rm -it ghcr.io/drwetter/testssl.sh

    If you still want to publish to Dockerhub from GH Actions, here are the official docs on how to configure the authentication in a secure way using "secrets": https://docs.github.com/en/actions/publishing-packages/publishing-docker-images

  12. drwetter commented on Nov 22, 2022

    @drwetter
    Collaborator

    Thanks @tenjaa and @eins78 .

    I lack currently a bit of time, but I had a quick look at the encrypted secrets page. From the security architecture perspective I am still wondering why one should handover + store passwords which is under other circumstances a "no, don't ever do that". Encrypting the password with another secret -- if understood that correctly -- doesn't make it better as I trust github to store that properly and there will never be flaws in the github workflow.

    Do I understand something wrong?

  13. eins78 commented on Nov 22, 2022

    @eins78

    @drwetter This part might be a bit misleading in their docs, I don't assume you'll enter your "personal" username + password into the GitHub secrets (which indeed would be "icky"), but rather an access-token for this purpose, which can be revoked in case there is a problem at Github or you just want to stop using them for whatever reason. You can do that in dockerhub here: https://hub.docker.com/settings/security

  14. drwetter commented on Nov 25, 2022

    @drwetter
    Collaborator

    @eins78 : That token seem to want read / write / delete access to docker hub.

    Currently it works that as soon as there is a push to one of the branches here (github), dockerhub just automatically builds the image. No credentials/token or whatsoever involved.

    I do not get why this image is amd64 only and whether this repo can do something to provide instructions for dockerhub to build other archs -- maybe with tags in the Dockerfile like FROM <ARCH>/alpine:<VERSION> or any TARGETPLATFORM or by any other means?

    That would be my first choice.

    PS: in the UX at dockerhub there was no setting where I could set the architecture. Albeit the UX is gruesome it looks like I didn't overlook such a setting.

  15. drwetter commented on Nov 25, 2022

    @drwetter
    Collaborator

    Maybe somebody can add a section ### From GitHub Container Registry to Dockerhub.md accordingly?

    That would be much appreciated!

  16. mschfh commented on Dec 17, 2024

    @mschfh

    @drwetter How are the Docker Hub images currently published?

    It might be enough to also log into the Docker Hub Registry as well and add it to the build-push-action tags:
    https://github.com/drwetter/testssl.sh/blob/3.2/.github/workflows/docker-3.2.yml#L62-L63

  17. drwetter commented on Dec 17, 2024

    @drwetter
    Collaborator

    How? The UI still kinda sucks as years ago and there's no button for adding an architecture. And I am not an expert for docker hub and would need some good docs which I can follow or an expert which did that and can give me a hand.

    Even a research yields not a document like "this-is-it" / "how-you-properly-do-it". Only workarounds like https://medium.com/@life-is-short-so-enjoy-it/docker-how-to-build-and-push-multi-arch-docker-images-to-docker-hub-64dea4931df9 .

    PS: And they signaled increased fees for next year.

  18. mschfh commented on Dec 17, 2024

    @mschfh

    How?

    It should just require another docker/login-action step as documented:

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

    Afterwards the Docker Hub tags need to be added to the parameter list of docker/build-push-action:

          - name: Build and push
            uses: docker/[email protected]
            with:
              push: ${{ github.event_name != 'pull_request' }}
              context: .
              file: Dockerfile.git
              platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le
              build-args: BUILD_VERSION
              cache-from: type=gha, scope=${{ github.workflow }}
              cache-to: type=gha, scope=${{ github.workflow }}
              labels: ${{ steps.docker_meta.outputs.labels }}
              tags: |
                ${{ github.repository }}:${{ env.BUILD_VERSION }}
                ${{ github.repository }}:latest
                ghcr.io/${{ github.repository }}:${{ env.BUILD_VERSION }}
                ghcr.io/${{ github.repository }}:latest

    See also:

    Docker Hub should automatically discover the architectures for multi-arch images, I'm not aware of any button/requirement to manually add it.

  19. drwetter commented on Dec 17, 2024

    @drwetter
    Collaborator

    been through that, discussed it.

    I don't like to hand over the login to github for now. This is security wise a bad idea.

    That maybe reconsidered if I have time next year to move this repo to https://github.com/testssl along with readjustments on the dockerhub side.

  20. drwetter commented on Apr 6, 2025

    @drwetter
    Collaborator

    see #2729 / #2730

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions