fix: musl(Alpine)で静的ビルドし外部HTTPS通信を復旧 - #47
Conversation
glibc で静的リンクしたバイナリは provided.al2023 上で外部 HTTPS 通信に 失敗し(OpenSSL 初期化エラー)、api.github.com / hooks.slack.com へ到達 できなかった。ビルドベースを crystallang/crystal:latest-alpine(musl)へ 切り替え、静的リンク用ライブラリ(openssl-libs-static / zlib-static / libevent-static)を apk add で明示導入することで外部通信を復旧する。 github_notifications_slack#89 を本リポジトリに適用。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ncf7NZnj7J6EnqDBCBr7RD
There was a problem hiding this comment.
Code Review
This pull request updates the Docker build step in serverless.yml to use an Alpine-based Crystal image and installs static libraries to fix HTTPS communication issues on AWS Lambda's provided.al2023 runtime. The review feedback recommends pinning the Docker image version instead of using latest-alpine to ensure build reproducibility, and changing the ownership of the generated bootstrap binary back to the host user to avoid permission issues during cleanup or caching.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
概要
本家 github_notifications_slack#89 の修正を本リポジトリ(Crystal 版)へ適用します。
背景・問題
provided.al2023ランタイム上で外部 HTTPS 通信に失敗する(OpenSSL の初期化エラー:unregistered scheme)。api.github.com/hooks.slack.comへ到達できず、Slack 通知が届かない状態になっていた。変更内容
serverless.ymlのビルドフック(before:package:createDeploymentArtifacts)を変更:crystallang/crystal:latest(glibc)→crystallang/crystal:latest-alpine(musl)へ切り替え。musl ベースの静的バイナリでは外部 HTTPS 通信が正常に動作する。openssl-libs-static/zlib-static/libevent-static)をapk add --no-cacheで明示導入し、ベースイメージ更新時のリンク失敗を防止。あわせて、上記の理由を説明するコメントを
serverless.ymlに追記しています。🤖 Generated with Claude Code
https://claude.ai/code/session_01Ncf7NZnj7J6EnqDBCBr7RD
Generated by Claude Code