Dockerfile, additional scripts and minor improvements#20
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.
curious: why is -ldflags '-extldflags "-static"' needed? I thought that Go produces static binaries by default.
There was a problem hiding this comment.
This guarantees that external libraries are statically linked.
There was a problem hiding this comment.
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.
You are totally right, we don't need it here.
…gs on build_container script; fix: dry_run quotation
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! |
|
Really sorry for the very long delay processing this. Thank you @drodbar for your contribution. I'll release an official version soon. |
Upgrade
amqp091-gomodule to v0.10.0 and Go to version to 1.24.Modify
main.goto return usage message when no queue is provided.Update CHANGELOG.md and README.md
Add
Dockerfileand.dockerignoreAdd scripts to
build_container,testandwait-for-it.sh