I made a bootstrap container to associate an Elastic IP address #2497
stefansundin
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Cool! You might get a smaller binary by setting the compiler to optimize for binary size https://doc.rust-lang.org/cargo/reference/profiles.html 3MB seems pretty good though for a static binary. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone.
I just wanted to show off a project I've been working on. I have made a bootstrap container that can associate an Elastic IP address with the EC2 instance that you're booting up.
Check it out here: https://github.com/stefansundin/bottlerocket-bootstrap-associate-eip
In my case I want to be able to run a single EC2 instance that is hosting an application using ECS. I don't need or want to pay for a load balancer, so the simplest way to achieve that is to just use an EIP. I want to be able to easily replace the instance and have the new instance automatically associate the EIP.
I decided to write it in Rust to try to make the docker image as small as possible, and thus make the performance impact of using the container as small as possible. The arm64 image is around 3 MB while the x86_64 image is around 3.44 MB. Can anyone think of another language choice that might be able to make it even smaller? Or is Rust the optimal choice?
Please let me know what you think. Let me know if you can think of any potential improvements as well.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions