• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15FROM ubuntu:19.10
16RUN apt-get update &&\
17    apt-get install -y \
18        libc6-dev \
19        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.
26ENV PW_ROOT /cache/pigweed
27ENV PW_ENVIRONMENT_ROOT /cache/environment
28ENV PW_CIPD_PACKAGE_FILES "$PW_ROOT/pw_env_setup/py/pw_env_setup/cipd_setup/*.json"
29
30WORKDIR $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/
36# --shell-file is required, but we're going to ignore it.
37RUN $PW_ROOT/pw_env_setup/py/pw_env_setup/env_setup.py \
38    --shell-file $PW_ROOT/init.sh \
39    --pw-root $PW_ROOT \
40    --install-dir $PW_ENVIRONMENT_ROOT
41
42CMD /bin/bash
43