-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve support for alpine linux (#675)
* Add alpine linux docker image * Support alpine via ???-unknown-linux-musl bindings * Setup GitHub CI * Satiate clippy * Add clippy-fix make target
- Loading branch information
Showing
26 changed files
with
165 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM alpine:3.20 | ||
|
||
VOLUME ["/aws_lc_rs"] | ||
|
||
WORKDIR / | ||
|
||
RUN apk add \ | ||
alpine-sdk \ | ||
bash \ | ||
boost-dev \ | ||
build-base \ | ||
busybox-suid \ | ||
clang-dev \ | ||
cargo \ | ||
curl \ | ||
cmake \ | ||
openssl-dev | ||
|
||
ARG UID | ||
RUN adduser -u $UID -S -s /bin/sh -G abuild satoshi | ||
USER satoshi | ||
WORKDIR /home/satoshi | ||
ENV CARGO_HTTP_MULTIPLEXING=false | ||
|
||
# If needed, setup Rust environment for user | ||
#RUN cd "${HOME}" && \ | ||
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > ./rustup.sh && \ | ||
# chmod +x ./rustup.sh && \ | ||
# ./rustup.sh -y && \ | ||
# . "${HOME}/.cargo/env" && \ | ||
# echo '. "${HOME}/.cargo/env"' >> ${HOME}/.profile && \ | ||
# cargo install --locked bindgen-cli && \ | ||
# rustup component add rustfmt clippy && \ | ||
# rm ./rustup.sh | ||
|
||
COPY aws_lc_rs_build.sh / | ||
COPY entry.sh / | ||
|
||
ENTRYPOINT ["/entry.sh"] |
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,14 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -ex -o pipefail | ||
|
||
SRC_DIR="${SRC_DIR:-/aws_lc_rs}" | ||
|
||
pushd "${SRC_DIR}" | ||
|
||
cargo test -p aws-lc-rs | ||
cargo clean | ||
|
||
popd # ${SRC_DIR} |
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,26 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -ex | ||
|
||
SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) | ||
|
||
# Ubuntu: | ||
# sudo apt-get install jq | ||
|
||
# Amazon Linux: | ||
# sudo yum install jq | ||
|
||
# Log Docker hub limit https://docs.docker.com/docker-hub/download-rate-limit/#how-can-i-check-my-current-rate | ||
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token) | ||
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | ||
|
||
EXTRA_ARGS=() | ||
if [[ -n "${GOPROXY:+x}" ]]; then | ||
EXTRA_ARGS=("--build-arg" "GOPROXY=${GOPROXY}" "${EXTRA_ARGS[@]}") | ||
fi | ||
|
||
pushd "${SCRIPT_DIR}" | ||
docker build -t alpine:3.20 . --build-arg UID=$(id -u) --load "${EXTRA_ARGS[@]}" | ||
popd |
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,7 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -ex -o pipefail | ||
|
||
/aws_lc_rs_build.sh "${argv[@]}" |
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
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
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
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 |
---|---|---|
|
@@ -252,7 +252,7 @@ impl PrkMode { | |
return Err(Unspecified); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
Ok(()) | ||
} | ||
|
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
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
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
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
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
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 |
---|---|---|
|
@@ -47,7 +47,7 @@ fn rsa_from_pkcs8_test() { | |
"Input: {}", | ||
test::to_hex(input.as_slice()) | ||
), | ||
}; | ||
} | ||
|
||
Ok(()) | ||
}, | ||
|
Oops, something went wrong.