spring-cloud-kubernetes icon indicating copy to clipboard operation
spring-cloud-kubernetes copied to clipboard

Mac M1 Support

Open ryanjbaxter opened this issue 3 years ago • 18 comments

@wind57 did you ever come to a solution for this problem with regards to building spring-cloud-kubernetes on an M1 Mac? https://github.com/paketo-buildpacks/stacks/issues/51

ryanjbaxter avatar Nov 30 '22 17:11 ryanjbaxter

I did not. I was lazy and took the path of least resistance. I have docker files everywhere in this project, and that is why .gitignore has an entry for dockerfiles...

wind57 avatar Nov 30 '22 17:11 wind57

OK I can find someone on the buildpacks team and try and bug them I think.

In the meantime do you have a sample dockerfile?

ryanjbaxter avatar Dec 01 '22 15:12 ryanjbaxter

My docker files are very simple:

FROM bellsoft/liberica-openjdk-debian
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

and then I build with :

mvn clean install -Dskip.build.image=true -DskipITs -DskipTests -T 1C -U

and to build an arm image:

docker buildx build --platform linux/arm64 -t springcloud/spring-cloud-kubernetes-discoveryserver:3.0.0-SNAPSHOT .

wind57 avatar Dec 01 '22 16:12 wind57

Even doing that I still am seeing

CreateContainerError: failed to create containerd container: error unpacking image: failed to resolve rootfs: content digest sha256:46f453b1b70ba9645399e1ce83c2412e67cb101e7da1189d28c73d83bc9d6619: not found

ryanjbaxter avatar Dec 01 '22 17:12 ryanjbaxter

if you do docker inspect --format='{{.Os}}/{{.Architecture}}' springcloud/spring-cloud-kubernetes-discoveryserver:3.0.0-SNAPSHOT do you see linux/arm64?

wind57 avatar Dec 01 '22 18:12 wind57

Yup

$ docker inspect --format='{{.Os}}/{{.Architecture}}' docker.io/springcloud/spring-cloud-kubernetes-discoveryclient-it:3.0.0-SNAPSHOT
linux/arm64

ryanjbaxter avatar Dec 01 '22 18:12 ryanjbaxter

weird :| I'll remove my docker desktop and give it a shot from scratch.

wind57 avatar Dec 01 '22 18:12 wind57

same even if I download from scratch. are you sure you downloaded docker for arm?

wind57 avatar Dec 01 '22 19:12 wind57

Yeah I reinstalled it just to make sure. How are you running the test then? I am just running the unit test from Intellij after I build the container.

ryanjbaxter avatar Dec 02 '22 00:12 ryanjbaxter

same thing. can you run a docker run ... on the image that you just build? this is super awkward, we are missing something obvious here, I am sure.

wind57 avatar Dec 02 '22 09:12 wind57

btw, where do you get this error:

CreateContainerError: failed to create containerd container: error unpacking image: failed to resolve rootfs: content digest sha256:46f453b1b70ba9645399e1ce83c2412e67cb101e7da1189d28c73d83bc9d6619: not found

I wonder if I have something installed that I do not remember now... Do you have Rosetta installed?

wind57 avatar Dec 02 '22 09:12 wind57

docker run starts fine.

The error is coming from the logs within the testcontainer.

ryanjbaxter avatar Dec 02 '22 13:12 ryanjbaxter

I assume that happens when you issue kubectl get events right inside the testcontainer, right? also what integration test is that?

wind57 avatar Dec 02 '22 17:12 wind57

Im such a dummy. I thought it was the integration test container giving that error, it was the container for the discovery server. Once I built the discovery server image with the Dockerfile it worked 🤦‍♂️. Sorry about that.

I am traveling next week but maybe after the holidays I can try and get some help from someone on the buildpacks team to sort this out.

ryanjbaxter avatar Dec 03 '22 00:12 ryanjbaxter

no worries at all and thank you for trying to ping someone on the buildpacks team.

wind57 avatar Dec 03 '22 07:12 wind57

Any tips on running the integration tests on kind in the 2.1.x branch?

ryanjbaxter avatar Dec 06 '22 02:12 ryanjbaxter

I remember having some custom scripts when I was running those, but since we moved to testcontainers, I deleted them :( Sorry

wind57 avatar Dec 06 '22 18:12 wind57

No worries

ryanjbaxter avatar Dec 06 '22 18:12 ryanjbaxter