swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

Build Docker image for arm platform

Open maximede opened this issue 3 years ago • 10 comments

Hello,

In order to not run the swagger-editor using amd64 emulation on Apple silicon ( or any other arm platform ) , it'd be great to have Travis building a multi architecture docker image.

I tried the current Dockerfile build from my mac and the build went pretty well. Building multi arch should be as simple as running docker buildx instead of docker build.

something like :

docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --push --tag $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG --tag $DOCKER_IMAGE_NAME:latest .

instead of

    docker build -t $DOCKER_IMAGE_NAME .;
    docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG;
    docker push $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG;
    docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:latest;
    docker push $DOCKER_IMAGE_NAME:latest;

in https://github.com/swagger-api/swagger-editor/blob/master/build-tools/deploy-docker-hub-tag.sh

I'm happy submitting a PR but I'm pretty sure that Travis won't let me run that kind of things :)

maximede avatar Jul 12 '21 08:07 maximede

Any update on this? Always a pain to hit a hard wall because a provider hasn't built to support arm64 with buildx :(

nateemerson avatar Aug 25 '21 16:08 nateemerson

While I can build the image on ARM64 (Ubuntu on RPi), I cannot successfully deploy it. All I get is an nginx error when accessing the container's service at internal port 8080. Hmpf.

thediveo avatar Aug 30 '21 20:08 thediveo

Any update? I cant run this image on the new M1 Apple chips

expelledboy avatar Oct 18 '21 10:10 expelledboy

In the meantime I have built some of the swagger tools, as per the buildx instructions above.

Images

  • expend/swagger-editor built against swagger-editor-3.18.2
  • expend/swagger-ui built against swagger-ui-3.52.5
  • expend/swagger-codegen-cli built against swagger-codegen-2.4.23

expelledboy avatar Oct 18 '21 10:10 expelledboy

@expelledboy Could you also build the v3 version for arm64? swagger-codegen-cli-v3

fdeberle avatar Nov 10 '21 09:11 fdeberle

Its not entirely obvious to me how to build swagger-codegen-cli-v3

expelledboy avatar Nov 10 '21 10:11 expelledboy

If you just need a quick fix to run the editor locally:

  • Checkout the repo
  • Build it using docker buildx build --platform linux/arm64/v8 --tag swagger-editor:v1 --tag swagger-editor:latest .
  • Start it using docker run -d -p 80:8080 swagger-editor:v1

pliegl avatar Feb 14 '22 16:02 pliegl

Are there any plans on adding this?

fellnerse avatar May 23 '22 14:05 fellnerse

Similar to the above, this helped me on an M1 Mac:

docker run -d -p 80:8080 --platform linux/amd64 swaggerapi/swagger-editor 

tomardern avatar Mar 30 '23 08:03 tomardern

Similar to the above, this helped me on an M1 Mac:

docker run -d -p 80:8080 --platform linux/amd64 swaggerapi/swagger-editor 

UR my hero!

ikotamsl avatar Apr 10 '24 11:04 ikotamsl