# Wrong arch for arm64 images on dockerhub

**URL:** <https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258>\
**Category:** Drone Bugs\
**Tags:** docker\
**Created:** [July 13, 2022, 7:27am UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258 "2022-07-13T07:27:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragonchaser](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/dragonchaser/32/7792_2.png) [@dragonchaser](https://drone.discourse.group/u/dragonchaser)\
**Post date:** [July 13, 2022, 7:27am UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/1 "2022-07-13T07:27:21Z")

</div>

![image](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/3/331d8c2016c6bc8f867c396b8695efa04768c336.png)

It looks like the images published to dockerhub have the wrong arch, all images are build for amd64 not arm64. I would assume a bug in you build & publish pipeline. Can somebody fix that?

Regards

---

<div class="post-metadata">

**Author:** ![jimsheldon](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/jimsheldon/32/7760_2.png) [@jimsheldon](https://drone.discourse.group/u/jimsheldon)\
**Post date:** [July 13, 2022, 12:02pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/2 "2022-07-13T12:02:17Z")

</div>

Hello @dragonchaser

You are correct that some of the arm64 docker images for drone appear as amd64 images. I was curious about this as well.

It turns out that many of drone projects (plugins, extensions, runners) consist of just a single binary in the docker image. This is a bit of a “trick” when building Docker images, even though they appear as linux/amd64, the binary inside the image is linux/arm64, so it will work on that platform.

I agree the release pipelines for these projects should be updated so that they appear as the appropriate architecture, I will mention this to the team.

---

<div class="post-metadata">

**Author:** ![dragonchaser](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/dragonchaser/32/7792_2.png) [@dragonchaser](https://drone.discourse.group/u/dragonchaser)\
**Post date:** [July 13, 2022, 12:11pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/3 "2022-07-13T12:11:00Z")

</div>

Yeah one should not do this there is fallout to such approaches:  
For example I use netcat for healtchecks

```auto
nc -z 127.0.0.1 3000|| exit 1

```

This does not work with that construct on arm64. Thanks for taking care of this.

---

<div class="post-metadata">

**Author:** ![jimsheldon](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/jimsheldon/32/7760_2.png) [@jimsheldon](https://drone.discourse.group/u/jimsheldon)\
**Post date:** [July 13, 2022, 1:46pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/4 "2022-07-13T13:46:40Z")

</div>

Can you describe your use case? Is there a `nc` binary in an image that is the wrong architecture? I just want to make sure I understand.

---

<div class="post-metadata">

**Author:** ![dragonchaser](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/dragonchaser/32/7792_2.png) [@dragonchaser](https://drone.discourse.group/u/dragonchaser)\
**Post date:** [July 13, 2022, 2:07pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/5 "2022-07-13T14:07:42Z")

</div>

I am running drone on docker-swarm. I am using netcat as health check, as described above, to verify that port 3000 is open.  
This works fine for the amd64 runners, but fails on arm64. It is also somewhat hard to track down, since I can not attach to the console of the running containers, running `/bin/sh` works on amd64 but not on arch. I am assuming a wrong arch there as-well.

---

<div class="post-metadata">

**Author:** ![jimsheldon](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/jimsheldon/32/7760_2.png) [@jimsheldon](https://drone.discourse.group/u/jimsheldon)\
**Post date:** [July 13, 2022, 2:43pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/6 "2022-07-13T14:43:33Z")

</div>

Ok thanks. Can you clarify, is `nc` being run from within the drone container or from a different location? Thanks again

---

<div class="post-metadata">

**Author:** ![dragonchaser](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/dragonchaser/32/7792_2.png) [@dragonchaser](https://drone.discourse.group/u/dragonchaser)\
**Post date:** [July 13, 2022, 2:45pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/7 "2022-07-13T14:45:07Z")

</div>

Nc is run from within the container.

---

<div class="post-metadata">

**Author:** ![jimsheldon](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/jimsheldon/32/7760_2.png) [@jimsheldon](https://drone.discourse.group/u/jimsheldon)\
**Post date:** [July 13, 2022, 2:46pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/8 "2022-07-13T14:46:41Z")

</div>

Got it, now I understand, thanks!

---

<div class="post-metadata">

**Author:** ![brad](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/brad/32/4172_2.png) [@brad](https://drone.discourse.group/u/brad)\
**Post date:** [July 13, 2022, 3:49pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/9 "2022-07-13T15:49:37Z")

</div>

Drone builds all images on amd64 (using cross-compiling) and then we push a manifest file to assign the correct os and architecture to those the images. We have done it this way for years without issue. It appears something changed on the registry side, and docker is no longer respecting the os and architecture defined in the manifest. _See the screenshot from Dockerhub from a few months ago (correct) and a few weeks ago (incorrect)._

Before DockerHub Change:

 ![Screen Shot 2022-07-13 at 11.42.11 AM](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/1/18187ceef8a568073baeead005b564a7f0135d5d.png)

After DockerHub Change:

 ![Screen Shot 2022-07-13 at 11.47.27 AM](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/1/161ee7a54afe753b72b652737b8538197ed3aa24.png)

The good news is we have a relatively simple solution. The _docker build_ command added support for the _–platform_ flag so that we can force a specific os and architecture. The docker plugin should be updated to accept _platform_ in the settings section. This would require a code change and release to the Docker plugin.

```diff
  - name: amd64
    image: plugins/docker
    settings:
      repo: drone/drone-runner-docker
      auto_tag: true
      auto_tag_suffix: linux-arm64
      dockerfile: docker/Dockerfile.linux.arm64
+ platform: linux/arm64
      username:
        from_secret: docker_username
      password:
        from_secret: docker_password

```

Once the plugin supports _platform_ we can update the pipeline definition for affected images (as shown above) and ensure the platform is being set.

---

<div class="post-metadata">

**Author:** ![dragonchaser](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/dragonchaser/32/7792_2.png) [@dragonchaser](https://drone.discourse.group/u/dragonchaser)\
**Post date:** [July 14, 2022, 6:11am UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/10 "2022-07-14T06:11:26Z")

</div>

This does not really help me, this is not about enforcing the build arch for the pipeline but having the proper arch on the deployment to interact with the runner container.

The build results itself are fine…

---

<div class="post-metadata">

**Author:** ![brad](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/brad/32/4172_2.png) [@brad](https://drone.discourse.group/u/brad)\
**Post date:** [July 14, 2022, 9:07pm UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/11 "2022-07-14T21:07:57Z")

</div>

> [@dragonchaser](#):
>
> This does not really help me, this is not about enforcing the build arch for the pipeline but having the proper arch on the deployment to interact with the runner container.

You described the problem as _“It looks like the images published to dockerhub have the wrong arch”_. The enhancement that I proposed for the Docker plugin **helps us** publish the image with the correct architecture tags, which would solve the problem you described in your initial post.

---

<div class="post-metadata">

**Author:** ![dragonchaser](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/dragonchaser/32/7792_2.png) [@dragonchaser](https://drone.discourse.group/u/dragonchaser)\
**Post date:** [July 15, 2022, 7:23am UTC](https://drone.discourse.group/t/wrong-arch-for-arm64-images-on-dockerhub/12258/12 "2022-07-15T07:23:06Z")

</div>

Ahh ok, sorry misunderstanding on my behalf, I thought you meant this as a solution for my pipeline.
