Description:
I cloned the envoy project to the local by
git clone https://github.com/envoyproxy/envoy.git
But when I built it, something went wrong :
# pwd
/root/zq/src/envoy
# ./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.dev'
No remote cache bucket is set, skipping setup remote cache.
ENVOY_SRCDIR=/source
fatal: Not a git repository (or any parent up to mount point /build)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
is there something I need to set?
A couple of guesses:
1) Are you sure the run_envoy_docker.sh is running correctly, taking the second command as an argument?
2) Can you double check the .git folder is still there?
When I try ./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.dev' I get something that looks like:
$ ./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.dev'
...
805682b6c07c: Pull complete
95c3d0c58848: Pull complete
f3b3315199a6: Pull complete
Digest: sha256:db8321cfd8abe9f083c7357baa62693859c5905f76f74907767cb4588ff2c916
Status: Downloaded newer image for envoyproxy/envoy-build-ubuntu:ec38ecb88fd1abe55ab1daa2f6bd239ffccc9d98
No remote cache bucket is set, skipping setup remote cache.
ENVOY_SRCDIR=/source
remote: Enumerating objects: 75, done.
remote: Counting objects: 100% (75/75), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 74 (delta 72), reused 21 (delta 19), pack-reused 0
Unpacking objects: 100% (74/74), done.
From https://github.com/envoyproxy/envoy-filter-example
b856561..d553d12 master -> origin/master
HEAD is now at 6c0625c... integration: make test use 3-arg base class ctor (#69)
building using 36 CPUs
clang/clang++ toolchain configured
...
If I run just ./ci/do_ci.sh bazel.dev without the run_envoy_docker.sh script, then I get something pretty similar to what you posted:
$ ./ci/do_ci.sh bazel.dev
No remote cache bucket is set, skipping setup remote cache.
ENVOY_SRCDIR=/source
touch: cannot touch '/build/bazel.sentinel': Permission denied
$
@derekargueta I just cloned it and didn't change anything. And I can find .git folder by
# ll -a
...
drwxr-xr-x 8 root root 163 Jun 11 09:54 .git
...
Is it because this folder is hidden?
No that should be fine.
Can you double check my comment about run_envoy_docker.sh? I'd think you should also see some Docker output for pulling the image, I'm wondering why that is not showing.
This is the script content, I am sorry, I don't understand the script very well.
# cat run_envoy_docker.sh
#!/bin/bash
set -e
. ci/envoy_build_sha.sh
# We run as root and later drop permissions. This is required to setup the USER
# in useradd below, which is need for correct Python execution in the Docker
# environment.
USER=root
USER_GROUP=root
[[ -z "${IMAGE_NAME}" ]] && IMAGE_NAME="envoyproxy/envoy-build-ubuntu"
# The IMAGE_ID defaults to the CI hash but can be set to an arbitrary image ID (found with 'docker
# images').
[[ -z "${IMAGE_ID}" ]] && IMAGE_ID="${ENVOY_BUILD_SHA}"
[[ -z "${ENVOY_DOCKER_BUILD_DIR}" ]] && ENVOY_DOCKER_BUILD_DIR=/tmp/envoy-docker-build
[[ -f .git ]] && [[ ! -d .git ]] && GIT_VOLUME_OPTION="-v $(git rev-parse --git-common-dir):$(git rev-parse --git-common-dir)"
mkdir -p "${ENVOY_DOCKER_BUILD_DIR}"
# Since we specify an explicit hash, docker-run will pull from the remote repo if missing.
docker run --rm -t -i -e HTTP_PROXY=${http_proxy} -e HTTPS_PROXY=${https_proxy} \
-u "${USER}":"${USER_GROUP}" -v "${ENVOY_DOCKER_BUILD_DIR}":/build ${GIT_VOLUME_OPTION} \
-v "$PWD":/source -e NUM_CPUS --cap-add SYS_PTRACE --cap-add NET_RAW --cap-add NET_ADMIN "${IMAGE_NAME}":"${IMAGE_ID}" \
/bin/bash -lc "groupadd --gid $(id -g) -f envoygroup && useradd -o --uid $(id -u) --gid $(id -g) --no-create-home \
--home-dir /source envoybuild && usermod -a -G pcap envoybuild && su envoybuild -c \"cd source && $*\""
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
I've run into this issue before, maybe it's because of where the envoy docker build is? I have the same not a git repository error, and running just ./ci/do_ci.sh bazel.dev gives me a permission denied error like above.
Try
export ENVOY_DOCKER_BUILD_DIR=~/tmp/envoy-docker-build/
and then running
./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.dev'
That worked for me.
@asraa Very thanks! That worked for me, too. Now I have built it successfully. Closing this.
Most helpful comment
I've run into this issue before, maybe it's because of where the envoy docker build is? I have the same not a git repository error, and running just ./ci/do_ci.sh bazel.dev gives me a permission denied error like above.
Try
export ENVOY_DOCKER_BUILD_DIR=~/tmp/envoy-docker-build/
and then running
./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.dev'
That worked for me.