GithubHelp home page GithubHelp logo

wtnabe / example-cnbp-builder-extension-and-extended-run-image Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13 KB

License: BSD 2-Clause "Simplified" License

Ruby 67.21% Procfile 1.35% Shell 27.59% Dockerfile 3.86%
cloudnativebuildpack ruby gdbm rocksdb google-cloud-platform

example-cnbp-builder-extension-and-extended-run-image's Introduction

An example of Cloud Native Buildpacks extensions and extended run-image

できること

Cloud Native Buildpacks を利用して、既存のイメージに存在しないパッケージを利用した gem をインストール、これを利用した ruby プログラムを動作させる。

  • google-22 builder を使い、build image をオリジナルの buildpack と extension で拡張する
  • google-22 builder の run image を親に持つ run image をビルドする
  • 結果、クラウド上で Ruby + gdbm / rocksdb を利用したイメージを動かす

注意

2024-01-28 時点でメジャーどころでは google-22 builder でしか動かない。

Google のドキュメント1によると既存の builder image を親に持つイメージを自分で作れば使えそうだが、 実際やってみると "could not parse reference" と言われる。

確認環境

  • macOS ( arm64 )
  • colima 0.6.7
  • Docker
    • Client 25.0.0
    • Server 24.0.7
  • pack 0.32.1+git-b14250b.build-5241
  • Google Cloud Run

目的

  • default の build image, run image の両方に必要なパッケージを追加して Ruby の native extension をビルドし、動かす

準備

使い方

$ ./bin/prepare-images
$ ./bin/build

あとは動かしたいプラットフォーム向けに build 済みの docker image を push したりなんだりしてください。

今回やっていないこと / できなかったこと

  • 独自 builder をゼロから作る
    • builder を作る場合、buildpack の指定をゼロから全部やらなきゃいけないので面倒くさい。できるだけやりたくない。

Buildpacksのビルダーをスクラッチから作ってみる | フューチャー技術ブログ

  • 公式のドキュメントでは extension で run image の拡張ができそうに見えるのだが、それはできなかった

Generating a run.Dockerfile that extends the runtime base image · Cloud Native Buildpacks

Footnotes

  1. Configure your build and run images  |  Buildpacks  |  Google Cloud

example-cnbp-builder-extension-and-extended-run-image's People

Contributors

wtnabe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.