|
1 | 1 | FROM gcr.io/gcp-runtimes/ubuntu_16_0_4:latest
|
2 | 2 |
|
3 |
| -# Install Bazel (https://docs.bazel.build/versions/master/install-ubuntu.html) |
4 |
| -RUN apt-get update -y && apt-get install openjdk-8-jdk wget git unzip build-essential -y |
5 |
| -RUN wget https://github.com/bazelbuild/bazel/releases/download/0.24.0/bazel-0.24.0-installer-linux-x86_64.sh -O /tmp/bazel-installer.sh |
| 3 | +# Install Bazel (https://docs.bazel.build/versions/master/install-ubuntu.html#install-with-installer-ubuntu). |
| 4 | +RUN apt-get update -y && apt-get install -y \ |
| 5 | + # The JDK requirement is from the instructions for the bazel apt package, |
| 6 | + # which we're not using here, but let's be safe. |
| 7 | + openjdk-8-jdk \ |
| 8 | + # These requirements are from the link above. |
| 9 | + pkg-config zip g++ zlib1g-dev unzip python3 \ |
| 10 | + # And why should python3 have all the fun? |
| 11 | + python \ |
| 12 | + # We also need git for git_repository to work. Maybe these other ones too. |
| 13 | + git unzip build-essential \ |
| 14 | + # And wget for the below command. |
| 15 | + wget |
| 16 | + |
| 17 | +RUN wget https://github.com/bazelbuild/bazel/releases/download/0.28.0/bazel-0.28.0-installer-linux-x86_64.sh -O /tmp/bazel-installer.sh |
6 | 18 | RUN chmod +x /tmp/bazel-installer.sh && /tmp/bazel-installer.sh
|
7 |
| -RUN bazel help info >/dev/null 2>&1 |
8 | 19 |
|
9 |
| -# Install Python 2.7.12 |
10 |
| -RUN apt-get install python -y |
| 20 | +# Sanity check the install. |
| 21 | +RUN bazel help info >/dev/null 2>&1 |
11 | 22 |
|
12 |
| -# Build par files. We have a source and work directory to avoid |
13 |
| -# stomping on other files as root. |
| 23 | +# Build par files. We have a source and work directory to avoid stomping on |
| 24 | +# other files as root. |
14 | 25 | CMD cp -r /opt/rules_python_source /opt/rules_python && \
|
15 | 26 | cd /opt/rules_python && \
|
16 | 27 | bazel clean && \
|
17 |
| - bazel build //rules_python:piptool.par //rules_python:whltool.par && \ |
| 28 | + bazel build //rules_python:piptool.par //rules_python:whltool.par \ |
| 29 | + # This works around a bug in git_repository to give us better debugging |
| 30 | + # if there's an error. |
| 31 | + # TODO(brandjon): Remove this once we're using Bazel 0.29, which |
| 32 | + # contains the fix. |
| 33 | + --incompatible_string_join_requires_strings=false && \ |
18 | 34 | cp bazel-bin/rules_python/piptool.par bazel-bin/rules_python/whltool.par /opt/rules_python_source/tools/ && \
|
19 | 35 | chown --reference=/opt/rules_python_source/update_tools.sh /opt/rules_python_source/tools/piptool.par /opt/rules_python_source/tools/whltool.par
|
0 commit comments