mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-07 03:22:46 -05:00
### Does this PR have any customer impact? yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) bugfix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) no ### Are you introducing any new config? If yes, do you have tests with and without them being set? no ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description - enable building both locally & in docker - fix the hardcoded paths ---- #### AI description (iteration 1) #### PR Classification Enhancement: Updates to build scripts and Docker configuration to enable building the gateway both locally and in Docker. #### PR Summary This pull request revises several scripts and configuration files to integrate local and containerized build processes for the gateway. - **`/oss/scripts/emulator_entrypoint.sh`**: Refactors the configuration file handling by defining a variable and updating file permissions and copy paths. - **`/oss/scripts/build_and_start_gateway.sh`**: Introduces a local build process using Cargo (clean, build, and binary copy) and adjusts the binary execution path. - **`/oss/.github/containers/Build-Ubuntu/Dockerfile_gateway`**: Updates copy paths to place the gateway binary and configuration into the new subfolder. - **`/oss/rust-toolchain.toml` & `/oss/pg_documentdb_gw/.gitignore`**: Adds the Cargo component to the toolchain and ensures the built binary is ignored. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Signed-off-by: Shuai Tian <shuaitian@microsoft.com>
To Build Ubuntu prebuild image
E.g. to build for Ubuntu 22.04, PostgreSQL 16, amd64 and documentdb_0.103.0, run:
docker build -t <image-tag> -f .github/containers/Build-Ubuntu/Dockerfile_prebuild \
--platform=linux/amd64 --build-arg BASE_IMAGE=ubuntu:22.04 --build-arg POSTGRES_VERSION=16 \
--build-arg DEB_PACKAGE_REL_PATH=packaging/packages/ubuntu22.04-postgresql-16-documentdb_0.103.0_amd64.deb .
To use the image
Step 1: Running the container in detached mode
docker run -dt <image-tag>
docker exec -it <container-id> bash
Step 2: Connect to psql shell
psql -p 9712 -d postgres