blob: 8d6c18da83846af1dbda3d361bbfc73899379aa8 [file] [log] [blame]
Rob Mohre916d322020-07-17 09:07:32 -07001# 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
15FROM ubuntu:19.10
16RUN apt-get update &&\
17 apt-get install -y \
Rob Mohr056b9ce2020-08-03 10:51:31 -070018 libc6-dev \
Rob Mohre916d322020-07-17 09:07:32 -070019 python \
20 git
21
22ENV 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 Mohre5f50fa2020-07-30 08:50:49 -070026ENV PW_ROOT /cache/pigweed
27ENV PW_ENVIRONMENT_ROOT /cache/environment
Rob Mohre916d322020-07-17 09:07:32 -070028ENV PW_CIPD_PACKAGE_FILES "$PW_ROOT/pw_env_setup/py/pw_env_setup/cipd_setup/*.json"
29
Johan Euphrosine461a4d92020-07-21 00:03:56 +090030WORKDIR $PW_ROOT
31# env_setup requires .git for determining top-level directory with git rev-parse
32ENV EMAIL "docker-build <>"
33RUN git init
34RUN git commit --allow-empty --allow-empty-message -m ''
35COPY pw_env_setup/ $PW_ROOT/pw_env_setup/
Rob Mohre916d322020-07-17 09:07:32 -070036# --shell-file is required, but we're going to ignore it.
Johan Euphrosine91e8b452020-07-20 23:42:58 +090037RUN $PW_ROOT/pw_env_setup/py/pw_env_setup/env_setup.py \
Rob Mohre916d322020-07-17 09:07:32 -070038 --shell-file $PW_ROOT/init.sh \
39 --pw-root $PW_ROOT \
40 --install-dir $PW_ENVIRONMENT_ROOT
Rob Mohre916d322020-07-17 09:07:32 -070041
42CMD /bin/bash