ページの先頭行へ戻る
Enterprise Postgres 15 オペレーターユーザーズガイド

4.6.3 SQLite外部データラッパーをFEPサーバコンテナに追加

SQLite外部データラッパーモジュールをFEPサーバコンテナに追加し、カスタマイズする例を説明します。

  1. Dockerfile を作成します。

    #use FEP 15 image as a base to compile sqlite_fdw
    FROM quay.io/fujitsu/fujitsu-enterprise-postgres-15-server:ubi8-15-1.0 as compile-sqlite_fdw
    
    #change the user with root privilege
    USER root
    
    # install build tools
    RUN microdnf -y install cmake gcc-c++ libtool clang which openssl-devel git llvm gettext
    
    # Install sqlite_fdw build require
    RUN microdnf install -y sqlite-devel
    
    # Download sqlite_fdw source
    RUN curl -sSL https://github.com/pgspider/sqlite_fdw/archive/refs/tags/v2.3.0.tar.gz | tar -zxf -
    
    # Compile sqlite_fdw
    RUN cd /sqlite_fdw-2.3.0 && \
        make install USE_PGXS=1
    
    #Use base image is from FEPContainer to build the custom image
    FROM quay.io/fujitsu/fujitsu-enterprise-postgres-15-server:ubi8-15-1.0
    
    #change the user with root privilege
    USER root
    
    #copy the prepared OSS extension binaries to FEP server lib folder
    COPY --from=compile-sqlite_fdw /opt/fsepv15server64/lib/sqlite_fdw.so /opt/fsepv15server64/lib/
    COPY --from=compile-sqlite_fdw /opt/fsepv15server64/lib/bitcode/sqlite_fdw /opt/fsepv15server64/lib/bitcode/
    COPY --from=compile-sqlite_fdw /opt/fsepv15server64/share/extension/sqlite_fdw* /opt/fsepv15server64/share/extension/
    
    # Install sqlite_fdw run time dependencies
    RUN microdnf install -y sqlite-libs
    
    #change the user to postgresql
    USER 26
    
  2. カスタムイメージをビルドします。

    docker build -f Dockerfile -t my.registry/my-repo/fep-15-server-sqlite_fdw:ubi8-15-1.0
  3. カスタムコンテナレジストリにイメージをpushします。

    docker push my.registry/my-repo/fep-15-server-sqlite_fdw:ubi8-15-1.0