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

Incorrect command for building ARM64 plugins for on-premise #231

Open
SafinWasi opened this issue Jan 22, 2025 · 1 comment
Open

Incorrect command for building ARM64 plugins for on-premise #231

SafinWasi opened this issue Jan 22, 2025 · 1 comment

Comments

@SafinWasi
Copy link

The command for building custom plugins for on-premise ARM64 installations is incorrect. In addition, the code header is also incorrect, as it says "Build your plugin for Alpine ARM64" for both Alpine and non-Alpine.

https://www.krakend.io/docs/extending/writing-plugins/#plugin-builder

Image

Incorrect command:

docker run -it -v "$PWD:/app" -w /app \
-e "CGO_ENABLED=1" \
-e "CC=aarch64-linux-musl-gcc" \
-e "GOARCH=arm64" \
-e "GOHOSTARCH=amd64" \
krakend/builder:2.9.1-linux-generic \
go build -ldflags='-extldflags=-fuse-ld=bfd -extld=aarch64-linux-musl-gcc' \
-buildmode=plugin -o yourplugin.so .

Correct command:

docker run -it -v "$PWD:/app" -w /app \
-e "CGO_ENABLED=1" \
-e "CC=aarch64-linux-gnu-gcc" \
-e "GOARCH=arm64" \
-e "GOHOSTARCH=amd64" \
krakend/builder:2.9.1-linux-generic \
go build -ldflags='-extldflags=-fuse-ld=bfd -extld=aarch64-linux-gnu-gcc' \
-buildmode=plugin -o yourplugin.so .

aarch64-linux-musl-gcc only exists on alpine images. For the generic image aarch64-linux-gnu-gcc must be used.

@alombarte
Copy link
Member

@SafinWasi thanks for reporting this inconsistency!

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

2 participants