Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scripts/create-docker-container.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,24 @@ else
ARGS="${*}"
fi

# disable asyncpreempt on MacOS ARM64 (Apple Silicon) as it may cause sporadic errors in emulation
# see: https://github.com/golang/go/issues/42774
DISABLE_ASYNC_PREEMPT=
if [ "$(uname -sm)" == "Darwin arm64" ]; then
DISABLE_ASYNC_PREEMPT='--env GODEBUG=asyncpreemptoff=1'
fi

docker pull "${IMAGE}"
docker rm -f $CONTAINER_NAME
docker run -it \
--env "DB=${DB}" \
--env "REPO_NAME=$REPO_NAME" \
--env "REPO_PATH=/repo" \
$DISABLE_ASYNC_PREEMPT \
--rm \
--name "$CONTAINER_NAME" \
-v "${REPO_PATH}:/repo" \
-v "${CI}:/ci" \
${ARGS} \
"${IMAGE}" \
/bin/bash