Skip to content

Packaging support on Alpine Linux #131

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

Merged
merged 3 commits into from
Nov 23, 2021

Conversation

specious
Copy link
Contributor

Added packaging support on Alpine Linux with the native musl C library.

Building inside an Alpine Docker container looks like:

...
[100%] Built target experimental
  adding: bin/ (stored 0%)
  adding: bin/experimental (deflated 71%)
  adding: bootstrap (deflated 22%)
  adding: lib/ (stored 0%)
  adding: lib/ld-musl-x86_64.so.1 (deflated 37%)
  adding: lib/libcurl.so.4 (deflated 53%)
  adding: lib/libstdc++.so.6 (deflated 69%)
  adding: lib/libgcc_s.so.1 (deflated 56%)
  adding: lib/libnghttp2.so.14 (deflated 56%)
  adding: lib/libssl.so.1.1 (deflated 60%)
  adding: lib/libcrypto.so.1.1 (deflated 54%)
  adding: lib/libbrotlidec.so.1 (deflated 58%)
  adding: lib/libz.so.1 (deflated 50%)
  adding: lib/libbrotlicommon.so.1 (deflated 54%)
  adding: lib/libc.musl-x86_64.so.1 (stored 0%)
Created /opt/aws/lambda/experimental.zip
[100%] Built target aws-lambda-package-experimental

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@specious
Copy link
Contributor Author

Any chance someone could take a quick look at this PR?

Copy link
Contributor

@marcomagdy marcomagdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
@bmoffatt PTAL.

}

function package_libc_alpine() {
if grep -F "Alpine Linux" < /etc/os-release > /dev/null; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the long form of the command line option, please.
grep --fixed-strings

Copy link
Contributor Author

@specious specious Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcomagdy, now it doesn't build on Alpine, because busybox knows grep -F but it doesn't know it as --fixed-strings.

function package_libc_alpine() {
if grep -F "Alpine Linux" < /etc/os-release > /dev/null; then
if type apk > /dev/null 2>&1; then
apk info -L musl 2>/dev/null | pluck_so_files | sed 's/^/\//'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here if applicable. If not add a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants