Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature request] Specify docker image architecture #268

Closed
kahluagenie opened this issue Jun 2, 2022 · 3 comments
Closed

[Feature request] Specify docker image architecture #268

kahluagenie opened this issue Jun 2, 2022 · 3 comments

Comments

@kahluagenie
Copy link

kahluagenie commented Jun 2, 2022

🗣️ Foreword

Thanks for the badass project! Ran into an issue that I was able to work around, but wanted to suggest a feature.

It would be great to specify the architecture of docker images that should be pulled.

To give some background why this is brought up, we have a pretty old version of chef running in our environment. As a result, the only docker images published for it are amd64 architecture. This becomes a problem when trying to run on an arm64 with modern OS images.

🙍 Problem Statement

When running on arm64 (M1 Macs) and trying to test old chef versions, there is a conflict:

  • chef amd64 image gets pulled because it's the only one available
  • arm64 platform os image gets pulled because that's the host platform

This creates a conflict when trying to actually run the whole stack and I end up with

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

(including the error just in case someone else is struggling and my workaround helps them)

❔ Possible Solution

It would be great to be able to specify architecture in line with docker's docker pull --platform option. So I imagine it to look like this

platforms:
- name: centos-7
  driver:
    image: dokken/centos-7
    platform: linux/amd64

Or maybe call the option architecture not to confuse with platforms at the root level?

⤴️ Describe alternatives you've considered

I was able to solve the problem by specifying a digest for an amd64 OS image to be in line with chef. This is good in terms of having reproducible builds/tests, but might not be the desired solution in all situations.

Example:

platforms:
  - name: centos-7
    driver:
      image: dokken/centos-7@sha256:4e13798dd2d565eae71c5c7aced26037fb3632583f23288211d487b24bba1654
@nrocco
Copy link
Contributor

nrocco commented Jun 27, 2022

A while ago i started experimenting with the source code of kitchen-dokken to see if this was possible, the proof of concept result is #272

This allows to satisfy my use case where we have a up-to-date infrastructure managed by chef. We build debian packages for the amd64 architecture (this is what we run in production) but our engineers have MacBook M1's with arm64 processors.

@tas50
Copy link
Member

tas50 commented Dec 22, 2022

Shipped in 2.18

@tas50 tas50 closed this as completed Dec 22, 2022
@kahluagenie
Copy link
Author

Much appreciated!!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants