From 528e1cc1c458de8241e9268d78a1a2aed48705b7 Mon Sep 17 00:00:00 2001 From: Ryan McGowan Date: Thu, 9 Feb 2017 18:37:33 -0800 Subject: [PATCH 1/3] Change user and group to root:root id -u and id -g was not finding a matching user in the container which caused issues running various commands. --- ci/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/README.md b/ci/README.md index 73faed9cf81f2..255cd1cdba746 100644 --- a/ci/README.md +++ b/ci/README.md @@ -7,7 +7,7 @@ building Envoy binaries and running tests that reflects the latest built image. An example basic invocation to build a debug image and run all tests is: - `docker run -t -i -u $(id -u):$(id -g) -v :/source lyft/envoy-build:latest /bin/bash -c "cd /source && ci/do_ci.sh debug"` + `docker run -t -i -u root:root -v :/source lyft/envoy-build:latest /bin/bash -c "cd /source && ci/do_ci.sh debug"` This bind mounts ``, which allows for changes on the local filesystem to be consumed and outputs build artifacts in `/build`. @@ -25,7 +25,7 @@ The `do_ci.sh` targets are: A convenient shell function to define is: - `run_envoy_docker() { docker run -t -i -u $(id -u):$(id -g) -v $PWD:/source lyft/envoy-build:latest /bin/bash -c "cd /source && $*";}` + `run_envoy_docker() { docker run -t -i -u root:root -v $PWD:/source lyft/envoy-build:latest /bin/bash -c "cd /source && $*";}` This then allows for a simple invocation of `run_envoy_docker './ci/do_ci.sh debug'` from the Envoy source tree. From 013429fd7eb8488d3cf03e91da6b5b73021df8e9 Mon Sep 17 00:00:00 2001 From: Ryan McGowan Date: Fri, 10 Feb 2017 11:27:18 -0800 Subject: [PATCH 2/3] Details --- ci/README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/ci/README.md b/ci/README.md index 255cd1cdba746..336ef55693168 100644 --- a/ci/README.md +++ b/ci/README.md @@ -7,7 +7,18 @@ building Envoy binaries and running tests that reflects the latest built image. An example basic invocation to build a debug image and run all tests is: - `docker run -t -i -u root:root -v :/source lyft/envoy-build:latest /bin/bash -c "cd /source && ci/do_ci.sh debug"` +```bash +docker run -t -i -u $(id -u):$(id -g) -v :/source lyft/envoy-build:latest /bin/bash -c "cd /source && ci/do_ci.sh debug" +``` + +On OSX using the command below may work better. Unlike on Linux, users are not +synced between the container and OS. Additionally, the bind mount will not +create artifacts with the same ownership as in the container ([read more about +osxfs][osxfs]). + +```bash +docker run -t -i -u root:root -v :/source lyft/envoy-build:latest /bin/bash -c "cd /source && ci/do_ci.sh debug" +``` This bind mounts ``, which allows for changes on the local filesystem to be consumed and outputs build artifacts in `/build`. @@ -25,7 +36,15 @@ The `do_ci.sh` targets are: A convenient shell function to define is: - `run_envoy_docker() { docker run -t -i -u root:root -v $PWD:/source lyft/envoy-build:latest /bin/bash -c "cd /source && $*";}` +```bash +run_envoy_docker() { docker run -t -i -u $(id -u):$(id -g) -v $PWD:/source lyft/envoy-build:latest /bin/bash -c "cd /source && $*";}` +``` + +Or on OSX. + +```bash +run_envoy_docker() { docker run -t -i -u root:root -v $PWD:/source lyft/envoy-build:latest /bin/bash -c "cd /source && $*";} +``` This then allows for a simple invocation of `run_envoy_docker './ci/do_ci.sh debug'` from the Envoy source tree. @@ -44,3 +63,6 @@ Envoy source tree. under. For example, to run a subset of tests under `gdb`: `run_envoy_docker 'RUN_TEST_UNDER="gdb --args" UNIT_TEST_ONLY=1 ./ci/do_ci.sh debug --gtest_filter="*Dns*"'`. * A `SKIP_CHECK_FORMAT` environment variable is available to skip `clang-format` checks while developing locally, e.g. `run_envoy_docker 'SKIP_CHECK_FORMAT=1 ./ci/do_ci.sh debug'`. + + +[osxfs]: https://docs.docker.com/docker-for-mac/osxfs/ From 5ef54cd91c7bb1202b225dc3027e25385c19afb6 Mon Sep 17 00:00:00 2001 From: Ryan McGowan Date: Fri, 10 Feb 2017 11:28:09 -0800 Subject: [PATCH 3/3] typo --- ci/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/README.md b/ci/README.md index 336ef55693168..825a196272dd9 100644 --- a/ci/README.md +++ b/ci/README.md @@ -37,7 +37,7 @@ The `do_ci.sh` targets are: A convenient shell function to define is: ```bash -run_envoy_docker() { docker run -t -i -u $(id -u):$(id -g) -v $PWD:/source lyft/envoy-build:latest /bin/bash -c "cd /source && $*";}` +run_envoy_docker() { docker run -t -i -u $(id -u):$(id -g) -v $PWD:/source lyft/envoy-build:latest /bin/bash -c "cd /source && $*";} ``` Or on OSX.