-
Notifications
You must be signed in to change notification settings - Fork 46
Dockerfile, additional scripts and minor improvements #20
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
base: main
Are you sure you want to change the base?
Conversation
Modify main.go to return help when no queue is provided Update README.md, and CHANGELOG.md Add Dockerfile and .dockerignore Add scripts build_container, test and wait-for-it.sh
Thank you @drodbar ! I'm away, I'll look at it sometime next week when I'm back. |
thanks @dubek! I just pushed another minor change to avoid breaking CICD changes within github, after I had changed the binary's path for convenience. |
Dockerfile
Outdated
RUN apk add --no-cache git | ||
RUN adduser -u ${UID} -D -h /app -H scratchuser | ||
|
||
RUN CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o rabbitmq-dump-queue . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious: why is -ldflags '-extldflags "-static"'
needed? I thought that Go produces static binaries by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guarantees that external libraries are statically linked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried building without this switch and I still get a static executable binary:
root@b25b978e723c:/src# CGO_ENABLED=0 go build -o rabbitmq-dump-queue .
root@b25b978e723c:/src# file rabbitmq-dump-queue
rabbitmq-dump-queue: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=fhhU8b2aXc28kCT16E8a/4QcClZJmZ-5y4WiCGkBh/NZLLOP-9hG60fNzI2C3U/Dimpzw275iXwL7wku7Pb, with debug_info, not stripped
root@b25b978e723c:/src# ldd rabbitmq-dump-queue
not a dynamic executable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are totally right, we don't need it here.
…gs on build_container script; fix: dry_run quotation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @drodbar for addressing my previous remarks. A few more comments below.
ea14c1c
to
a807f18
Compare
Hi @dubek, did you have a chance to look at the changes? I think there is nothing else to address in my end at the moment. Thanks! |
Upgrade
amqp091-go
module to v0.10.0 and Go to version to 1.24.Modify
main.go
to return usage message when no queue is provided.Update CHANGELOG.md and README.md
Add
Dockerfile
and.dockerignore
Add scripts to
build_container
,test
andwait-for-it.sh