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

[docker] Upgrade labs for cross-platform compatibility #508

Open
denik1981 opened this issue Sep 24, 2023 · 3 comments
Open

[docker] Upgrade labs for cross-platform compatibility #508

denik1981 opened this issue Sep 24, 2023 · 3 comments

Comments

@denik1981
Copy link

denik1981 commented Sep 24, 2023

Describe the bug
When running examples/labs for the docker workshop locally people will find that some Dockerfiles won't build because they are targeting a specific arch different than the one the user is running the docker daemon.

I have seen a lot of Dockerfiles targetting, for eg, alpine:3.5 as the base image which is amd64 specific
If you run the build in an arm64v8 arch like myself which I have a Mac you might encounter this compatibility error.

To Reproduce
Steps to reproduce the behavior:

  1. Check that your running architecture differs from amd64
uname -m // arm64
  1. Try to build this testing Dockerfile
FROM alpine:3.5
CMD ["/bin/echo", "Works!"]
docker build -t try .
  1. See error
[+] Building 1.1s (3/3) FINISHED                                                                                  docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                              0.0s
 => => transferring dockerfile: 79B                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                 0.0s
 => => transferring context: 2B                                                                                                   0.0s
 => ERROR [internal] load metadata for docker.io/library/alpine:3.5                                                               1.0s
------
 > [internal] load metadata for docker.io/library/alpine:3.5:
------
Dockerfile:1
--------------------
   1 | >>> FROM alpine:3.5
   2 |     CMD ["/bin/echo","Works!"]
--------------------
ERROR: failed to solve: alpine:3.5: no match for platform in manifest sha256:66952b313e51c3bd1987d7c4ddf5dba9bc0fb6e524eed2448fa660246b3e76ec: not found

Expected behavior
Build should be possible with more archs different than amd64.
There are some images that are multi-arch in the alpine official repo for the case and for the many other OS base-image repos that are used in the workshop.

Proposed solution

For alpine references please use instead apline:3 that targets to alpine:latest which is compatible with 386, amd64 and arm architectures. Proves to work well in my arm64v8 Mac.

Desktop (please complete the following information):

  • OS: uname -a
    Darwin Demians-MacBook-Pro.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64

Kudos to the creator and contributors of this wonderful workshop!

@ajeetraina
Copy link
Collaborator

@denik1981 I am going to fix those old alpine images. Also, we are planning to move these labs to mkdocs or Docusaurus for better structure layout.

@ajeetraina
Copy link
Collaborator

@denik1981 Would you like to raise PR updated with alpine:3.18 instead.

@Adesoji1
Copy link
Collaborator

Yes @denik1981 kindly raise a PR

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

No branches or pull requests

3 participants