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

Missing docker image for Apple Silicon (linux/arm64/v8) #11020

Closed
regisd opened this issue May 24, 2021 · 9 comments
Closed

Missing docker image for Apple Silicon (linux/arm64/v8) #11020

regisd opened this issue May 24, 2021 · 9 comments

Comments

@regisd
Copy link

regisd commented May 24, 2021

Description

The Docker image is unusable on Mac OS with Apple Silicon M1 chip.

Steps to reproduce
docker run swaggerapi/swagger-codegen-cli                                                  regisd@Mac-M1
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
^C
@regisd
Copy link
Author

regisd commented May 24, 2021

Note: openjdk/8-jre-alpine is published for platform linux/arm64/v8.

Hence, I think it's only missing an action to build and release the images for this platform.

@kznrluk
Copy link

kznrluk commented Jun 7, 2021

I have same problem too. The docker run command with M1 Mac will be hang up and I can't send any exit command.

@kluc
Copy link

kluc commented Jun 18, 2021

Same issue here. This page on docker (https://docs.docker.com/docker-for-mac/apple-silicon/) suggested adding --platform linux/amd64 which got rid of the warning but swagger-codegen still hangs for me.

@myedibleenso
Copy link

The base maven:3-jdk-8-alpine image used in the Dockerfile on master is compatible with arm64.

The problem is that swaggerapi isn't building and publishing a multi-platform image. I believe build_and_push_docker just needs to be changed to use buildx.

Probably something like ...

# get version/tag of current release
TAG=3.0.32
ORG=swaggerapi
IMAGE_NAME=swagger-codegen-cli
docker buildx build \
  --platform=linux/amd64,linux/arm64 \
  -f Dockerfile \
  --push \
  -t "${ORG}/${IMAGE_NAME}:${TAG}" \
  -t "${ORG}/${IMAGE_NAME}:latest" \
  .

As an interim solution, I've gone ahead and published a multi-platform image (parsertongue/swagger-codegen-cli:3.0.32) to Docker Hub using the latest release of the CLI:

@danieleds
Copy link

To build your own updated image, tested on M1:

  1. Clone the repo, checkout branch 3.0.0
  2. run ./run-in-docker.sh mvn clean package
  3. cd modules/swagger-codegen-cli
  4. run docker build -t swagger-codegen-cli-v3 .

@dfberry
Copy link

dfberry commented Oct 14, 2023

@danieleds When I use the container, after following your steps, I get Exception in thread "main" java.lang.UnsupportedClassVersionError: ch/qos/logback/classic/spi/LogbackServiceProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0. Any idea how to fix that?

@danieleds
Copy link

@dfberry perhaps they made some changes in the branch that broke it. Try starting from an older commit from the 3.0.0 branch: https://github.com/swagger-api/swagger-codegen/commits/3.0.0

@emoreth
Copy link

emoreth commented Nov 30, 2023

I had the same issue of @dfberry and tried going down a few versions. The last version working for me is swaggerapi/swagger-codegen-cli-v3:3.0.46, after that I get the Java version error.

PS: I'm running the docker image.

@frantuma
Copy link
Member

Thanks all for your patience, this has been fixed by the following changes adding multi-platform images builds:

For master - Swagger / OpenAPI 2.0:

#12290, #12291, #12292, #12293, #12294

for 3.0.0 - OpenAPI 3.0

#12298

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

8 participants