Skip to content

Commit f78ac44

Browse files
authored
Use the Dockerfile COPY instead of docker cp (#10943)
## Problem We use `docker cp` to copy the files required for the extension tests now. It causes problems if we run older images with the newer source tree. ## Summary of changes Copying the files was moved to the compute Dockerfile.
1 parent f4fefd9 commit f78ac44

File tree

4 files changed

+2
-4
lines changed

4 files changed

+2
-4
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
!compute/
1515
!compute_tools/
1616
!control_plane/
17+
!docker-compose/ext-src
1718
!libs/
1819
!pageserver/
1920
!pgxn/

compute/compute-node.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,7 @@ RUN make PG_VERSION="${PG_VERSION:?}" -C compute
18181818

18191819
FROM pg-build AS extension-tests
18201820
ARG PG_VERSION
1821-
RUN mkdir /ext-src
1821+
COPY docker-compose/ext-src/ /ext-src/
18221822

18231823
COPY --from=pg-build /postgres /postgres
18241824
#COPY --from=postgis-src /ext-src/ /ext-src/

docker-compose/docker_compose_test.sh

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ for pg_version in ${TEST_VERSION_ONLY-14 15 16 17}; do
5151
done
5252

5353
if [ $pg_version -ge 16 ]; then
54-
docker cp ext-src $TEST_CONTAINER_NAME:/
55-
docker exec $TEST_CONTAINER_NAME bash -c "apt update && apt install -y libtap-parser-sourcehandler-pgtap-perl"
5654
# This is required for the pg_hint_plan test, to prevent flaky log message causing the test to fail
5755
# It cannot be moved to Dockerfile now because the database directory is created after the start of the container
5856
echo Adding dummy config

docker-compose/test_extensions_upgrade.sh

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ new_vers=$(docker compose exec neon-test-extensions psql -Aqt -d contrib_regress
5757
docker compose --profile test-extensions down
5858
TAG=${OLDTAG} docker compose --profile test-extensions up --quiet-pull --build -d --force-recreate
5959
wait_for_ready
60-
docker compose cp ext-src neon-test-extensions:/
6160
docker compose exec neon-test-extensions psql -c "DROP DATABASE IF EXISTS contrib_regression"
6261
docker compose exec neon-test-extensions psql -c "CREATE DATABASE contrib_regression"
6362
docker compose exec neon-test-extensions psql -c "CREATE DATABASE pgtap_regression"

0 commit comments

Comments
 (0)