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

Describe better build pattern #59

Merged
merged 2 commits into from
Mar 11, 2021
Merged

Describe better build pattern #59

merged 2 commits into from
Mar 11, 2021

Conversation

johnseekins
Copy link
Contributor

With confluent-kafka-go and librdkafka, we can still build a static binary that is re-distributable. It just requires adding the -tags static switch to the build command.

@palmerabollo
Copy link
Member

Thanks John for your first contribution.
@jpfe-tid what do you think?

@johnseekins
Copy link
Contributor Author

Generally, I'd argue updating to a newer version of confluent-kafka-go would be good. I guess with >=1.4 you no longer need to package librdkafka yourself?

@palmerabollo palmerabollo merged commit 244d46b into Telefonica:master Mar 11, 2021
@jpfe-tid
Copy link
Contributor

jpfe-tid commented Mar 11, 2021

Thanks @johnseekins.

Generally, I'd argue updating to a newer version of confluent-kafka-go would be good. I guess with >=1.4 you no longer need to package librdkafka yourself?

Agree on that. I prefer to update confluent-kafka-go and keep the build process minimal.

Even after the changes proposed at #61, I can't build your PR. Here is the log:

Step 6/10 : RUN go build -tags static -o /prometheus-kafka-adapter
 ---> Running in 6867ff88d562
# github.com/confluentinc/confluent-kafka-go/kafka
gcc: error: /usr/lib/librdkafka-static.a: No such file or directory
The command '/bin/sh -c go build -tags static -o /prometheus-kafka-adapter' returned a non-zero code: 2

@jpfe-tid
Copy link
Contributor

@johnseekins I sent PR #63 which updates confluent-kafka-go to 1.6.1. it required switching build base image from alpine to debian buster.

@johnseekins
Copy link
Contributor Author

This is much better than what I did. Great!

@jpfe-tid
Copy link
Contributor

@johnseekins please help us trying the proposed changes looking for stability issues. Thanks for being a prometheus-kafka-adapter user 🙂

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

Successfully merging this pull request may close these issues.

None yet

3 participants