Skip to content

Commit

Permalink
feat: expose REST port for gcloud support
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Dec 4, 2023
1 parent 343190d commit b813d64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,6 @@ jobs:
export TAG=`echo $GITHUB_REF | awk -F/ '{print $NF}'`
echo $TAG
docker buildx create --name multi_platform --use
docker buildx build --platform linux/amd64,linux/arm64 \
. -f build/Dockerfile \
-t "$GCR_HOSTNAME"/"$IMAGE":"$TAG" \
-t "$GCR_HOSTNAME"/"$IMAGE":latest \
--push \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF"
docker buildx build --platform linux/amd64,linux/arm64 \
. -f build/distroless/Dockerfile \
-t "$GCR_HOSTNAME"/"$IMAGE"-distroless:"$TAG" \
-t "$GCR_HOSTNAME"/"$IMAGE"-distroless:latest \
--push \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF"
docker buildx build --platform linux/amd64,linux/arm64 \
. -f build/emulator/Dockerfile \
-t "$GCR_HOSTNAME"/"$IMAGE"-emulator:"$TAG" \
Expand Down
13 changes: 7 additions & 6 deletions build/emulator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ FROM gcr.io/cloud-spanner-pg-adapter/pgadapter AS pgadapter
ADD build/emulator/startup.sh /home/pgadapter/startup.sh
RUN chmod +x /home/pgadapter/startup.sh

# Add the emulator binary.
COPY --from=emulator --chown=nonroot /emulator_main /emulator/emulator_main
COPY --from=emulator --chown=nonroot /licenses.txt.gz /emulator/licenses.txt.gz
# Add the emulator binaries.
COPY --from=emulator /gateway_main /emulator/gateway_main
COPY --from=emulator /emulator_main /emulator/emulator_main
COPY --from=emulator /licenses.txt.gz /emulator/licenses.txt.gz
RUN chmod u+x /emulator/gateway_main
RUN chmod u+x /emulator/emulator_main

# Expose both 5432 (PGAdapter PostgreSQL port) and 9010 (Emulator gRPC port)
EXPOSE 5432
EXPOSE 9010
# Expose 5432 (PGAdapter PostgreSQL port), 9010 (Emulator gRPC port), and 9020 (Emulator REST port)
EXPOSE 5432 9010 9020

ENTRYPOINT ["/bin/bash", "/home/pgadapter/startup.sh"]
2 changes: 1 addition & 1 deletion build/emulator/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ do
fi
done

nohup sh -c "/emulator/emulator_main --host_port localhost:9010 &"
nohup sh -c "/emulator/gateway_main --hostname \"0.0.0.0\" &"

cd /home/pgadapter
COMMAND="java ${JAVA_ARGUMENTS} -jar pgadapter.jar ${ARGUMENTS}"
Expand Down

0 comments on commit b813d64

Please sign in to comment.