diff --git a/.github/workflows/grpc.yml b/.github/workflows/grpc.yml new file mode 100644 index 0000000..249af86 --- /dev/null +++ b/.github/workflows/grpc.yml @@ -0,0 +1,52 @@ +name: "aws-lambda-ruby-grpc:3.2" + +on: + pull_request: + paths: + - "grpc/ruby-3.2/Dockerfile" + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU (for emulation) + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + driver-opts: image=moby/buildkit:master + + - name: Log in to Docker Hub Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: ./grpc/ruby-3.2/ + file: ./grpc/ruby-3.2/Dockerfile + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/aws-lambda-ruby-grpc:3.2 + # - name: Scan + # id: scan + # uses: anchore/scan-action@v6 + # continue-on-error: true + # with: + # image: ${{ secrets.DOCKER_HUB_USERNAME }}/aws-lambda-ruby-grpc:3.2 + # fail-build: true + # output-format: sarif + # severity-cutoff: low + # add-cpes-if-none: true + # - name: Update PR with vulnerability scan results + # uses: forward3d/comment-failure-details@v1.0.0 + # with: + # report: ${{ steps.scan.outputs.sarif }} + # image-name: aws-lambda-ruby-grpc:3.2 diff --git a/grpc/ruby-3.2/Dockerfile b/grpc/ruby-3.2/Dockerfile new file mode 100644 index 0000000..5a88ff1 --- /dev/null +++ b/grpc/ruby-3.2/Dockerfile @@ -0,0 +1,23 @@ +FROM f3ddevelopers/aws-lambda-ruby-patched:3.2 + +RUN yum swap -y openssl-snapsafe-libs openssl-libs + +RUN yum update -y && \ + yum install -y make gcc gcc-c++ ruby-devel && \ + yum clean all + +COPY Gemfile . +COPY Gemfile.lock . + +RUN bundle config set deployment true && \ + bundle config set without 'test development' +# bundle config build.ffi -- --with-cflags="-Wno-implicit-function-declaration" && \ +# bundle config set retry 5 && \ +# bundle config set jobs $(getconf _NPROCESSORS_ONLN) && \ +# if [[ "$ARCHITECTURE" == "arm64" ]]; then \ +# bundle config set force_ruby_platform true && \ +# bundle config build.ffi --enable-libffi-alloc; \ +# fi && \ +# BUNDLE_FORCE_RUBY_PLATFORM=true bundle + +RUN BUNDLE_FORCE_RUBY_PLATFORM=true bundle diff --git a/grpc/ruby-3.2/Gemfile b/grpc/ruby-3.2/Gemfile new file mode 100644 index 0000000..a957f6c --- /dev/null +++ b/grpc/ruby-3.2/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'grpc' diff --git a/grpc/ruby-3.2/Gemfile.lock b/grpc/ruby-3.2/Gemfile.lock new file mode 100644 index 0000000..e175f54 --- /dev/null +++ b/grpc/ruby-3.2/Gemfile.lock @@ -0,0 +1,22 @@ +GEM + remote: https://rubygems.org/ + specs: + bigdecimal (3.2.2) + google-protobuf (4.32.0) + bigdecimal + rake (>= 13) + googleapis-common-protos-types (1.20.0) + google-protobuf (>= 3.18, < 5.a) + grpc (1.74.1) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + rake (13.3.0) + +PLATFORMS + ruby + +DEPENDENCIES + grpc + +BUNDLED WITH + 2.7.1