Skip to content

Commit cbd92aa

Browse files
committed
Annotated builddeps and rundeps
1 parent 5a4c3c9 commit cbd92aa

2 files changed

Lines changed: 16 additions & 28 deletions

File tree

2.7.11/onbuild/Dockerfile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,12 @@ RUN apk --no-cache add \
2020

2121

2222

23-
RUN apk --no-cache add --virtual .build-deps \
23+
RUN apk --no-cache add --virtual .builddeps \
2424
build-base \
2525
python-dev=$PYTHON_VERSION-r3 \
2626
openssl-dev \
2727
libffi-dev \
28-
zlib-dev \
29-
libmemcached-dev \
30-
postgresql-dev \
31-
libev-dev \
32-
libxml2-dev \
33-
libxslt-dev \
34-
jpeg-dev \
35-
tiff-dev \
36-
libwebp-dev \
37-
freetype-dev \
38-
openjpeg-dev && \
28+
zlib-dev && \
3929
ln -s /lib/libz.so /usr/lib/. && \
4030
pip install wheel==0.26.0 && \
4131
pip install \
@@ -48,14 +38,18 @@ RUN apk --no-cache add --virtual .build-deps \
4838
cryptography==1.2.1 \
4939
cffi==1.5.0 \
5040
certifi==2015.11.20.1 && \
41+
apk --no-cache add --virtual .rundeps \
42+
zlib && \
5143
mkdir -p /usr/src/app/
5244
WORKDIR /usr/src/app/
5345
CMD ["python"]
5446

5547
ONBUILD COPY requirements.txt /usr/src/app/
56-
ONBUILD RUN pip install -v -r requirements.txt && \
48+
ONBUILD RUN cat requirements.txt | grep -oh -E "builddeps:(\w|,|-)*" | awk '{split($0,a,":"); print a[2]}' | awk '{gsub(/,/, "\n", $0); print $0}' | sort -u | xargs apk --no-cache add --virtual .builddeps && \
49+
cat requirements.txt | grep -oh -E "rundeps:(\w|,|-)*" | awk '{split($0,a,":"); print a[2]}' | awk '{gsub(/,/, "\n", $0); print $0}' | sort -u | xargs apk --no-cache add --virtual .rundeps && \
50+
pip install -r requirements.txt && \
5751
pip uninstall -y cython && \
58-
apk del .build-deps && \
52+
apk del .builddeps && \
5953
find /usr/ \
6054
\( -type d -a -name test -o -name tests \) \
6155
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \

3.5.1/onbuild/Dockerfile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,7 @@ RUN apk --no-cache add --virtual .build-deps \
2525
python3-dev=$PYTHON_VERSION-r0 \
2626
openssl-dev \
2727
libffi-dev \
28-
zlib-dev \
29-
libmemcached-dev \
30-
postgresql-dev \
31-
libev-dev \
32-
libxml2-dev \
33-
libxslt-dev \
34-
jpeg-dev \
35-
tiff-dev \
36-
libwebp-dev \
37-
freetype-dev \
38-
openjpeg-dev && \
28+
zlib-dev && \
3929
ln -s /lib/libz.so /usr/lib/. && \
4030
pip install wheel==0.26.0 && \
4131
pip install \
@@ -48,17 +38,21 @@ RUN apk --no-cache add --virtual .build-deps \
4838
cryptography==1.2.1 \
4939
cffi==1.5.0 \
5040
certifi==2015.11.20.1 && \
41+
apk --no-cache add --virtual .rundeps \
42+
zlib && \
5143
mkdir -p /usr/src/app/
5244
WORKDIR /usr/src/app/
5345
CMD ["python"]
5446

5547
ONBUILD COPY requirements.txt /usr/src/app/
56-
ONBUILD RUN pip install -v -r requirements.txt && \
48+
ONBUILD RUN cat requirements.txt | grep -oh -E "builddeps:(\w|,|-)*" | awk '{split($0,a,":"); print a[2]}' | awk '{gsub(/,/, "\n", $0); print $0}' | sort -u | xargs apk --no-cache add --virtual .builddeps && \
49+
cat requirements.txt | grep -oh -E "rundeps:(\w|,|-)*" | awk '{split($0,a,":"); print a[2]}' | awk '{gsub(/,/, "\n", $0); print $0}' | sort -u | xargs apk --no-cache add --virtual .rundeps && \
50+
pip install -r requirements.txt && \
5751
pip uninstall -y cython && \
58-
apk del .build-deps && \
52+
apk del .builddeps && \
5953
find /usr/ \
6054
\( -type d -a -name test -o -name tests \) \
6155
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
6256
-exec rm -rf '{}' + && \
63-
find . -type f -name "*.pyc" -exec rm -rf '{}' +
57+
find . -type f -name "__pycache__" -exec rm -rf '{}' +
6458
ONBUILD COPY . /usr/src/app

0 commit comments

Comments
 (0)