Skip to content

Commit 342aea4

Browse files
Fix the test script does not work for Docker on macOS (#297)
### Motivation When I run `./pulsar-test-service-start.sh` on macOS m1 13.4, the standalone failed to start due to the wrong permission of the `test-conf` directory that is copied into the container via `docker cp`: ``` I have no name!@a00f70265760:/pulsar$ ls -l | grep test-conf drwx------ 3 501 dialout 4096 Jun 4 13:31 test-conf ``` It seems to be a bug: docker/for-mac#1814 ### Modifications Execute `docker run` with the current username via `id -u`.
1 parent 20f6fa0 commit 342aea4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pulsar-test-service-start.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ cd $SRC_DIR
2525

2626
./pulsar-test-service-stop.sh
2727

28-
CONTAINER_ID=$(docker run -i -p 8080:8080 -p 6650:6650 -p 8443:8443 -p 6651:6651 --rm --detach apachepulsar/pulsar:latest sleep 3600)
28+
CONTAINER_ID=$(docker run -i --user $(id -u) -p 8080:8080 -p 6650:6650 -p 8443:8443 -p 6651:6651 --rm --detach apachepulsar/pulsar:latest sleep 3600)
2929
build-support/setup-test-service-container.sh $CONTAINER_ID start-test-service-inside-container.sh
3030

3131
docker cp $CONTAINER_ID:/pulsar/data/tokens/token.txt .test-token.txt
3232

33-
CONTAINER_ID=$(docker run -i -p 8081:8081 -p 6652:6652 -p 8444:8444 -p 6653:6653 --rm --detach apachepulsar/pulsar:latest sleep 3600)
33+
CONTAINER_ID=$(docker run -i --user $(id -u) -p 8081:8081 -p 6652:6652 -p 8444:8444 -p 6653:6653 --rm --detach apachepulsar/pulsar:latest sleep 3600)
3434
build-support/setup-test-service-container.sh $CONTAINER_ID start-mim-test-service-inside-container.sh
3535

3636
echo "-- Ready to start tests"

0 commit comments

Comments
 (0)