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

Commit bea12fe

Browse files
realtyemreivilibre
authored andcommitted
Docker fully qualified image names (#15689)
* Fully qualified docker image names for the main Dockerfile and Complement related. * Fully qualified docker image names for Dockerfiles associated with building Debian release artifacts. This one is harder and is separate from the other commit in case it wasn't correct or was unwanted. I decided to do the expansion on the docker images in the Dockerfile itself, instead of the various source places that build which distribution that is selected, as it would have been more invasive with the scripts breaking up the string for tagging and such. This one is untested. * Changelog * Update docker/Dockerfile-workers * Update docker/complement/Dockerfile --------- Co-authored-by: reivilibre <[email protected]>
1 parent c5dc95b commit bea12fe

File tree

8 files changed

+15
-10
lines changed

8 files changed

+15
-10
lines changed

.github/workflows/release-artifacts.yml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- id: set-distros
3535
run: |
3636
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
37+
# NOTE: inside the actual Dockerfile-dhvirtualenv, the image name is expanded into its full image path
3738
dists='["debian:sid"]'
3839
if [[ $GITHUB_REF == refs/tags/* ]]; then
3940
dists=$(scripts-dev/build_debian_packages.py --show-dists-json)

changelog.d/15689.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add fully qualified docker image names to Dockerfiles.

docker/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ARG PYTHON_VERSION=3.11
2727
###
2828
# We hardcode the use of Debian bullseye here because this could change upstream
2929
# and other Dockerfiles used for testing are expecting bullseye.
30-
FROM docker.io/python:${PYTHON_VERSION}-slim-bullseye as requirements
30+
FROM docker.io/library/python:${PYTHON_VERSION}-slim-bullseye as requirements
3131

3232
# RUN --mount is specific to buildkit and is documented at
3333
# https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#build-mounts-run---mount.
@@ -87,7 +87,7 @@ RUN if [ -z "$TEST_ONLY_IGNORE_POETRY_LOCKFILE" ]; then \
8787
###
8888
### Stage 1: builder
8989
###
90-
FROM docker.io/python:${PYTHON_VERSION}-slim-bullseye as builder
90+
FROM docker.io/library/python:${PYTHON_VERSION}-slim-bullseye as builder
9191

9292
# install the OS build deps
9393
RUN \
@@ -158,7 +158,7 @@ RUN --mount=type=cache,target=/synapse/target,sharing=locked \
158158
### Stage 2: runtime
159159
###
160160

161-
FROM docker.io/python:${PYTHON_VERSION}-slim-bullseye
161+
FROM docker.io/library/python:${PYTHON_VERSION}-slim-bullseye
162162

163163
LABEL org.opencontainers.image.url='https://matrix.org/docs/projects/server/synapse'
164164
LABEL org.opencontainers.image.documentation='https://github.com/matrix-org/synapse/blob/master/docker/README.md'

docker/Dockerfile-dhvirtualenv

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ARG distro=""
2424
# https://launchpad.net/~jyrki-pulliainen/+archive/ubuntu/dh-virtualenv, but
2525
# it's not obviously easier to use that than to build our own.)
2626

27-
FROM ${distro} as builder
27+
FROM docker.io/library/${distro} as builder
2828

2929
RUN apt-get update -qq -o Acquire::Languages=none
3030
RUN env DEBIAN_FRONTEND=noninteractive apt-get install \
@@ -55,7 +55,7 @@ RUN cd /dh-virtualenv && DEB_BUILD_OPTIONS=nodoc dpkg-buildpackage -us -uc -b
5555
###
5656
### Stage 1
5757
###
58-
FROM ${distro}
58+
FROM docker.io/library/${distro}
5959

6060
# Get the distro we want to pull from as a dynamic build variable
6161
# (We need to define it in each build stage)

docker/Dockerfile-workers

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG FROM=matrixdotorg/synapse:$SYNAPSE_VERSION
77
# target image. For repeated rebuilds, this is much faster than apt installing
88
# each time.
99

10-
FROM debian:bullseye-slim AS deps_base
10+
FROM docker.io/library/debian:bullseye-slim AS deps_base
1111
RUN \
1212
--mount=type=cache,target=/var/cache/apt,sharing=locked \
1313
--mount=type=cache,target=/var/lib/apt,sharing=locked \
@@ -21,7 +21,7 @@ FROM debian:bullseye-slim AS deps_base
2121
# which makes it much easier to copy (but we need to make sure we use an image
2222
# based on the same debian version as the synapse image, to make sure we get
2323
# the expected version of libc.
24-
FROM redis:6-bullseye AS redis_base
24+
FROM docker.io/library/redis:6-bullseye AS redis_base
2525

2626
# now build the final image, based on the the regular Synapse docker image
2727
FROM $FROM

docker/complement/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# https://github.com/matrix-org/synapse/blob/develop/docker/README-testing.md#testing-with-postgresql-and-single-or-multi-process-synapse
88

99
ARG SYNAPSE_VERSION=latest
10+
# This is an intermediate image, to be built locally (not pulled from a registry).
1011
ARG FROM=matrixdotorg/synapse-workers:$SYNAPSE_VERSION
1112

1213
FROM $FROM
@@ -19,8 +20,8 @@ FROM $FROM
1920
# the same debian version as Synapse's docker image (so the versions of the
2021
# shared libraries match).
2122
RUN adduser --system --uid 999 postgres --home /var/lib/postgresql
22-
COPY --from=postgres:13-bullseye /usr/lib/postgresql /usr/lib/postgresql
23-
COPY --from=postgres:13-bullseye /usr/share/postgresql /usr/share/postgresql
23+
COPY --from=docker.io/library/postgres:13-bullseye /usr/lib/postgresql /usr/lib/postgresql
24+
COPY --from=docker.io/library/postgres:13-bullseye /usr/share/postgresql /usr/share/postgresql
2425
RUN mkdir /var/run/postgresql && chown postgres /var/run/postgresql
2526
ENV PATH="${PATH}:/usr/lib/postgresql/13/bin"
2627
ENV PGDATA=/var/lib/postgresql/data

docker/editable.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARG PYTHON_VERSION=3.9
1010
###
1111
# We hardcode the use of Debian bullseye here because this could change upstream
1212
# and other Dockerfiles used for testing are expecting bullseye.
13-
FROM docker.io/python:${PYTHON_VERSION}-slim-bullseye
13+
FROM docker.io/library/python:${PYTHON_VERSION}-slim-bullseye
1414

1515
# Install Rust and other dependencies (stolen from normal Dockerfile)
1616
# install the OS build deps

scripts-dev/build_debian_packages.py

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from types import FrameType
2121
from typing import Collection, Optional, Sequence, Set
2222

23+
# These are expanded inside the dockerfile to be a fully qualified image name.
24+
# e.g. docker.io/library/debian:bullseye
2325
DISTS = (
2426
"debian:buster", # oldstable: EOL 2022-08
2527
"debian:bullseye",

0 commit comments

Comments
 (0)