Skip to content

Commit c0609a8

Browse files
authored
Clean up binary generation Dockerfiles (#1080)
* Switches from using Python 2 to Python 3 for `bob-builder` * Adds `--no-install-recommends` to reduce unnecessary packages * Removes unnecessary pinning of pip for Heroku-18 build * Moves `DEBIAN_FRONTEND` to RUN level env var, given: https://serverfault.com/a/797318 Refs @W-8119717@. [skip changelog]
1 parent ef4696a commit c0609a8

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

builds/cedar-14.Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
FROM heroku/cedar:14
22

3-
WORKDIR /app
43
ENV WORKSPACE_DIR="/app/builds" \
54
S3_BUCKET="lang-python" \
65
S3_PREFIX="cedar-14/" \
7-
DEBIAN_FRONTEND=noninteractive \
86
STACK="cedar-14"
97

10-
RUN apt-get update && apt-get install -y python-pip libsqlite3-dev realpath && rm -rf /var/lib/apt/lists/*
8+
RUN apt-get update \
9+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
10+
libsqlite3-dev \
11+
python3-pip \
12+
realpath \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
WORKDIR /app
1116

1217
COPY requirements.txt /app/
13-
RUN pip install -r /app/requirements.txt
18+
# Can't use `--disable-pip-version-check --no-cache-dir` since not supported by Ubuntu 14.04's pip.
19+
RUN pip3 install -r /app/requirements.txt
1420

1521
COPY . /app

builds/heroku-16.Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
FROM heroku/heroku:16-build
22

3-
WORKDIR /app
43
ENV WORKSPACE_DIR="/app/builds" \
54
S3_BUCKET="lang-python" \
65
S3_PREFIX="heroku-16/" \
7-
DEBIAN_FRONTEND=noninteractive \
86
STACK="heroku-16"
97

10-
RUN apt-get update && apt-get install -y python-pip libsqlite3-dev && rm -rf /var/lib/apt/lists/*
8+
RUN apt-get update \
9+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
10+
libsqlite3-dev \
11+
python3-pip \
12+
python3-setuptools \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
WORKDIR /app
1116

1217
COPY requirements.txt /app/
13-
RUN pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
18+
RUN pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
1419

1520
COPY . /app

builds/heroku-18.Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
FROM heroku/heroku:18-build
22

3-
WORKDIR /app
43
ENV WORKSPACE_DIR="/app/builds" \
54
S3_BUCKET="lang-python" \
65
S3_PREFIX="heroku-18/" \
7-
DEBIAN_FRONTEND=noninteractive \
86
STACK="heroku-18"
97

10-
RUN apt-get update && apt-get install --no-install-recommends -y python-pip-whl=9.0.1-2 python-pip=9.0.1-2 python-setuptools python-wheel libsqlite3-dev && rm -rf /var/lib/apt/lists/*
8+
RUN apt-get update \
9+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
10+
libsqlite3-dev \
11+
python3-pip \
12+
python3-setuptools \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
WORKDIR /app
1116

1217
COPY requirements.txt /app/
13-
RUN pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
18+
RUN pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt
1419

1520
COPY . /app

0 commit comments

Comments
 (0)