@@ -50,14 +50,15 @@ RUN set -eux; \
50
50
rm -f /etc/apt/apt.conf.d/docker-clean; \
51
51
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache;
52
52
53
- # Install System level build requirements, this is done before
54
- # everything else because these are rarely ever going to change.
53
+ # Install System level build requirements, this is done before everything else
54
+ # because these are rarely ever going to change.
55
55
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
56
56
--mount=type=cache,target=/var/lib/apt,sharing=locked \
57
57
set -x \
58
58
&& apt-get update \
59
- && apt-get install --no-install-recommends -y \
60
- build-essential git libcairo2-dev libfreetype6-dev libjpeg-dev libpng-dev libz-dev
59
+ && apt-get install --no-install-recommends -y build-essential \
60
+ && apt-get clean \
61
+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
61
62
62
63
# We create an /opt directory with a virtual environment in it to store our
63
64
# application in.
@@ -124,23 +125,6 @@ ARG CI=no
124
125
# i.e. 'docker compose run --rm web python -m warehouse shell --type=ipython')
125
126
ARG IPYTHON=no
126
127
127
- # By default, Docker has special steps to avoid keeping APT caches in the layers, which
128
- # is good, but in our case, we're going to mount a special cache volume (kept between
129
- # builds), so we WANT the cache to persist.
130
- RUN set -eux; \
131
- rm -f /etc/apt/apt.conf.d/docker-clean; \
132
- echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache;
133
-
134
- # Install System level Warehouse build requirements, this is done before
135
- # everything else because these are rarely ever going to change.
136
- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
137
- --mount=type=cache,target=/var/lib/apt,sharing=locked \
138
- set -x \
139
- && apt-get update \
140
- && apt-get install --no-install-recommends -y \
141
- build-essential libffi-dev libxml2-dev libxslt-dev libpq-dev libcurl4-openssl-dev libssl-dev \
142
- $(if [ "$DEVEL" = "yes" ]; then echo 'libjpeg-dev' ; fi)
143
-
144
128
# We create an /opt directory with a virtual environment in it to store our
145
129
# application in.
146
130
RUN set -x \
@@ -208,23 +192,24 @@ ARG DEVEL=no
208
192
# as well for the matrix!
209
193
ARG CI=no
210
194
211
- # This is a work around because otherwise postgresql-client bombs out trying
212
- # to create symlinks to these directories.
213
- RUN set -x \
214
- && mkdir -p /usr/share/man/man1 \
215
- && mkdir -p /usr/share/man/man7
195
+ # By default, Docker has special steps to avoid keeping APT caches in the layers, which
196
+ # is good, but in our case, we're going to mount a special cache volume (kept between
197
+ # builds), so we WANT the cache to persist.
198
+ RUN set -eux; \
199
+ rm -f /etc/apt/apt.conf.d/docker-clean; \
200
+ echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache;
216
201
217
202
# Install System level Warehouse requirements, this is done before everything
218
203
# else because these are rarely ever going to change.
219
204
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
220
205
--mount=type=cache,target=/var/lib/apt,sharing=locked \
221
206
set -x \
222
- && apt-get update \
223
- && apt-get install --no-install-recommends -y \
224
- libpq5 libxml2 libxslt1.1 libcurl4 \
225
- $(if [ "$DEVEL" = "yes" ]; then echo 'bash libjpeg62 postgresql-client build-essential libffi-dev libxml2-dev libxslt-dev libpq-dev libcurl4-openssl-dev libssl-dev vim oathtool' ; fi) \
226
- && apt-get clean \
227
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
207
+ && if [ "$DEVEL" = "yes" ]; then \
208
+ apt-get update \
209
+ && apt-get install --no-install-recommends -y build-essential postgresql-client \
210
+ && apt-get clean \
211
+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
212
+ fi
228
213
229
214
# Copy the directory into the container, this is done last so that changes to
230
215
# Warehouse itself require the least amount of layers being invalidated from
0 commit comments