Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit ebad183

Browse files
committed
Revert spurious changes
1 parent 88abd49 commit ebad183

File tree

2 files changed

+217
-206
lines changed

2 files changed

+217
-206
lines changed

docker/Dockerfile

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ FROM docker.io/python:${PYTHON_VERSION}-slim as requirements
3737
# https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#build-mounts-run---mount.
3838
# Here we use it to set up a cache for apt (and below for pip), to improve
3939
# rebuild speeds on slow connections.
40-
RUN apt-get update && apt-get install -y git \
41-
&& rm -rf /var/lib/apt/lists/*
40+
RUN \
41+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
42+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
43+
apt-get update && apt-get install -y git \
44+
&& rm -rf /var/lib/apt/lists/*
4245

4346
# We install poetry in its own build stage to avoid its dependencies conflicting with
4447
# synapse's dependencies.
@@ -51,7 +54,8 @@ RUN apt-get update && apt-get install -y git \
5154
#
5255
# NB: In poetry 1.2 `poetry export` will be moved into a plugin; we'll need to also
5356
# pip install poetry-plugin-export (https://github.com/python-poetry/poetry-plugin-export).
54-
RUN pip install --user "poetry-core==1.1.0a7" "git+https://github.com/python-poetry/poetry.git@fb13b3a676f476177f7937ffa480ee5cff9a90a5"
57+
RUN --mount=type=cache,target=/root/.cache/pip \
58+
pip install --user "poetry-core==1.1.0a7" "git+https://github.com/python-poetry/poetry.git@fb13b3a676f476177f7937ffa480ee5cff9a90a5"
5559

5660
WORKDIR /synapse
5761

@@ -66,27 +70,31 @@ RUN /root/.local/bin/poetry export --extras all -o /synapse/requirements.txt
6670
FROM docker.io/python:${PYTHON_VERSION}-slim as builder
6771

6872
# install the OS build deps
69-
RUN apt-get update && apt-get install -y \
70-
build-essential \
71-
libffi-dev \
72-
libjpeg-dev \
73-
libpq-dev \
74-
libssl-dev \
75-
libwebp-dev \
76-
libxml++2.6-dev \
77-
libxslt1-dev \
78-
openssl \
79-
rustc \
80-
zlib1g-dev \
81-
&& rm -rf /var/lib/apt/lists/*
73+
RUN \
74+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
75+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
76+
apt-get update && apt-get install -y \
77+
build-essential \
78+
libffi-dev \
79+
libjpeg-dev \
80+
libpq-dev \
81+
libssl-dev \
82+
libwebp-dev \
83+
libxml++2.6-dev \
84+
libxslt1-dev \
85+
openssl \
86+
rustc \
87+
zlib1g-dev \
88+
&& rm -rf /var/lib/apt/lists/*
8289

8390
# To speed up rebuilds, install all of the dependencies before we copy over
8491
# the whole synapse project, so that this layer in the Docker cache can be
8592
# used while you develop on the source
8693
#
8794
# This is aiming at installing the `[tool.poetry.depdendencies]` from pyproject.toml.
8895
COPY --from=requirements /synapse/requirements.txt /synapse/
89-
RUN pip install --prefix="/install" --no-deps --no-warn-script-location -r /synapse/requirements.txt
96+
RUN --mount=type=cache,target=/root/.cache/pip \
97+
pip install --prefix="/install" --no-deps --no-warn-script-location -r /synapse/requirements.txt
9098

9199
# Copy over the rest of the synapse source code.
92100
COPY synapse /synapse/synapse/
@@ -107,17 +115,20 @@ LABEL org.opencontainers.image.documentation='https://github.com/matrix-org/syna
107115
LABEL org.opencontainers.image.source='https://github.com/matrix-org/synapse.git'
108116
LABEL org.opencontainers.image.licenses='Apache-2.0'
109117

110-
RUN apt-get update && apt-get install -y \
111-
curl \
112-
gosu \
113-
libjpeg62-turbo \
114-
libpq5 \
115-
libwebp6 \
116-
xmlsec1 \
117-
libjemalloc2 \
118-
libssl-dev \
119-
openssl \
120-
&& rm -rf /var/lib/apt/lists/*
118+
RUN \
119+
--mount=type=cache,target=/var/cache/apt,sharing=locked \
120+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
121+
apt-get update && apt-get install -y \
122+
curl \
123+
gosu \
124+
libjpeg62-turbo \
125+
libpq5 \
126+
libwebp6 \
127+
xmlsec1 \
128+
libjemalloc2 \
129+
libssl-dev \
130+
openssl \
131+
&& rm -rf /var/lib/apt/lists/*
121132

122133
COPY --from=builder /install /usr/local
123134
COPY ./docker/start.py /start.py
@@ -128,4 +139,4 @@ EXPOSE 8008/tcp 8009/tcp 8448/tcp
128139
ENTRYPOINT ["/start.py"]
129140

130141
HEALTHCHECK --start-period=5s --interval=15s --timeout=5s \
131-
CMD curl -fSs http://localhost:8008/health || exit 1
142+
CMD curl -fSs http://localhost:8008/health || exit 1

0 commit comments

Comments
 (0)