aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorJohan Euphrosine <proppy@google.com>2020-07-21 00:03:56 +0900
committerCQ Bot Account <commit-bot@chromium.org>2020-07-21 18:56:43 +0000
commit461a4d9822585011ce7f74871545ce96ec1a78a0 (patch)
treee882bae3d52183ff329b10332f855bcbc69fd16e /docker
parent91e8b4505f4e929efd41ff60fdf69db2c74ae24c (diff)
downloadpigweed-461a4d9822585011ce7f74871545ce96ec1a78a0.tar.gz
docker: cache env_setup bootstrap
- add empty commit (required by env_setup) - copy env_setup from the build context first - run/cache env_setup bootstrap - copy remaining pigweed sources from the build context Bug: 216 Change-Id: If1ad1cc7da3c0f1bccfe1cacbcf93e876206fc47 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/14241 Commit-Queue: Johan Euphrosine <proppy@google.com> Reviewed-by: Rob Mohr <mohrr@google.com>
Diffstat (limited to 'docker')
-rw-r--r--docker/Dockerfile8
1 files changed, 7 insertions, 1 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 449385142..c96858230 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -26,11 +26,17 @@ ENV PW_ROOT /pigweed-cache/pigweed
ENV PW_ENVIRONMENT_ROOT /pigweed-cache/environment
ENV PW_CIPD_PACKAGE_FILES "$PW_ROOT/pw_env_setup/py/pw_env_setup/cipd_setup/*.json"
-COPY . $PW_ROOT
+WORKDIR $PW_ROOT
+# env_setup requires .git for determining top-level directory with git rev-parse
+ENV EMAIL "docker-build <>"
+RUN git init
+RUN git commit --allow-empty --allow-empty-message -m ''
+COPY pw_env_setup/ $PW_ROOT/pw_env_setup/
# --shell-file is required, but we're going to ignore it.
RUN $PW_ROOT/pw_env_setup/py/pw_env_setup/env_setup.py \
--shell-file $PW_ROOT/init.sh \
--pw-root $PW_ROOT \
--install-dir $PW_ENVIRONMENT_ROOT
+COPY . $PW_ROOT
CMD /bin/bash