Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 1 | # Copyright 2020 The Pigweed Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
| 14 | |
| 15 | FROM ubuntu:19.10 |
| 16 | RUN apt-get update &&\ |
| 17 | apt-get install -y \ |
Rob Mohr | 056b9ce | 2020-08-03 10:51:31 -0700 | [diff] [blame] | 18 | libc6-dev \ |
Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 19 | python \ |
| 20 | git |
| 21 | |
| 22 | ENV CIPD_CACHE_DIR /pigweed-cache/cipd-cache-dir |
| 23 | # This is only for seeding the environment, not meant to be used. Running |
| 24 | # bootstrap inside another checkout will reset PW_ROOT but leave |
| 25 | # PW_ENVIRONMENT_ROOT alone. |
Rob Mohr | e5f50fa | 2020-07-30 08:50:49 -0700 | [diff] [blame] | 26 | ENV PW_ROOT /cache/pigweed |
| 27 | ENV PW_ENVIRONMENT_ROOT /cache/environment |
Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 28 | ENV PW_CIPD_PACKAGE_FILES "$PW_ROOT/pw_env_setup/py/pw_env_setup/cipd_setup/*.json" |
| 29 | |
Johan Euphrosine | 461a4d9 | 2020-07-21 00:03:56 +0900 | [diff] [blame] | 30 | WORKDIR $PW_ROOT |
| 31 | # env_setup requires .git for determining top-level directory with git rev-parse |
| 32 | ENV EMAIL "docker-build <>" |
| 33 | RUN git init |
| 34 | RUN git commit --allow-empty --allow-empty-message -m '' |
| 35 | COPY pw_env_setup/ $PW_ROOT/pw_env_setup/ |
Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 36 | # --shell-file is required, but we're going to ignore it. |
Johan Euphrosine | 91e8b45 | 2020-07-20 23:42:58 +0900 | [diff] [blame] | 37 | RUN $PW_ROOT/pw_env_setup/py/pw_env_setup/env_setup.py \ |
Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 38 | --shell-file $PW_ROOT/init.sh \ |
| 39 | --pw-root $PW_ROOT \ |
| 40 | --install-dir $PW_ENVIRONMENT_ROOT |
Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 41 | |
| 42 | CMD /bin/bash |