-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3840d6e
commit ffce431
Showing
6 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This image has more logging enabled and the binary is not stripped. | ||
# https://docs.aws.amazon.com/sdk-for-rust/latest/dg/logging.html | ||
|
||
FROM rust:1-bullseye AS builder | ||
|
||
ARG TARGETARCH | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y musl-tools | ||
|
||
WORKDIR /src | ||
|
||
ENV CC=musl-gcc | ||
ENV AR=ar | ||
ENV RUST_BACKTRACE=full | ||
|
||
ADD . . | ||
|
||
RUN rustup --version | ||
|
||
RUN case "$TARGETARCH" in \ | ||
arm64) TARGET=aarch64-unknown-linux-musl ;; \ | ||
amd64) TARGET=x86_64-unknown-linux-musl ;; \ | ||
*) echo "Does not support $TARGETARCH" && exit 1 ;; \ | ||
esac && \ | ||
rustup target add $TARGET && \ | ||
cargo build --release --target $TARGET && \ | ||
mv target/$TARGET/release/bottlerocket-bootstrap-associate-eip target/release/ | ||
|
||
# Copy the binary into an empty docker image | ||
FROM scratch | ||
|
||
LABEL org.opencontainers.image.authors="Stefan Sundin" | ||
LABEL org.opencontainers.image.url="https://github.com/stefansundin/bottlerocket-bootstrap-associate-eip" | ||
|
||
COPY --from=builder /src/target/release/bottlerocket-bootstrap-associate-eip /bottlerocket-bootstrap-associate-eip | ||
|
||
# Use the CA bundle from the Bottlerocket file system | ||
ENV SSL_CERT_FILE=/.bottlerocket/rootfs/etc/pki/tls/certs/ca-bundle.crt | ||
|
||
# Enable more verbose logs | ||
ENV RUST_BACKTRACE=full | ||
ENV RUST_LOG=aws | ||
|
||
ENTRYPOINT [ "/bottlerocket-bootstrap-associate-eip" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters