Skip to content

Commit df9b783

Browse files
committed
Fix unknown arch in manifests
See docker/build-push-action#820 (comment)
1 parent 1fa43a6 commit df9b783

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Dockerfile

+12-12
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ARG CI_COMMIT_SHA=dev
4848

4949
# - Intermediary stages
5050
# * build-node
51-
FROM node:16 AS build-node
51+
FROM --platform=$TARGETPLATFORM node:16 AS build-node
5252

5353
# Copy the files required to install npm packages
5454
WORKDIR /app
@@ -66,25 +66,25 @@ RUN cd frontend && ENV=${ENV} npm ci --quiet --production
6666
COPY frontend /app/frontend
6767

6868
# * build-node-django [build-node]
69-
FROM build-node as build-node-django
69+
FROM --platform=$TARGETPLATFORM build-node as build-node-django
7070

7171
RUN mkdir /app/api && cd frontend && npm run bundledjango
7272

7373
# * build-node-selfhosted [build-node]
74-
FROM build-node as build-node-selfhosted
74+
FROM --platform=$TARGETPLATFORM build-node as build-node-selfhosted
7575

7676
RUN cd frontend && npm run bundle
7777

7878
# * build-python
79-
FROM python:3.11 as build-python
79+
FROM --platform=$TARGETPLATFORM python:3.11 as build-python
8080
WORKDIR /app
8181

8282
COPY api/pyproject.toml api/poetry.lock api/Makefile ./
8383
ENV POETRY_VIRTUALENVS_CREATE=false POETRY_HOME=/usr/local
8484
RUN make install opts='--without dev'
8585

8686
# * build-python-private [build-python]
87-
FROM build-python AS build-python-private
87+
FROM --platform=$TARGETPLATFORM build-python AS build-python-private
8888

8989
# Authenticate git with token, install SAML binary dependency,
9090
# private Python dependencies, and integrate private modules
@@ -98,7 +98,7 @@ RUN --mount=type=secret,id=github_private_cloud_token \
9898
make install-private-modules
9999

100100
# * api-runtime
101-
FROM python:3.11-slim as api-runtime
101+
FROM --platform=$TARGETPLATFORM python:3.11-slim as api-runtime
102102

103103
WORKDIR /app
104104

@@ -119,7 +119,7 @@ CMD ["migrate-and-serve"]
119119

120120
# - Target (shippable) stages
121121
# * private-cloud-api [api-runtime, build-python-private]
122-
FROM api-runtime as private-cloud-api
122+
FROM --platform=$TARGETPLATFORM api-runtime as private-cloud-api
123123

124124
COPY --from=build-python-private /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
125125
COPY --from=build-python-private /usr/local/bin /usr/local/bin
@@ -130,7 +130,7 @@ RUN touch ./ENTERPRISE_VERSION
130130
USER nobody
131131

132132
# * private-cloud-unified [api-runtime, build-python-private, build-node-django]
133-
FROM api-runtime as private-cloud-unified
133+
FROM --platform=$TARGETPLATFORM api-runtime as private-cloud-unified
134134

135135
COPY --from=build-node-django /app/api/static /app/static
136136
COPY --from=build-node-django /app/api/app/templates/webpack /app/app/templates/webpack
@@ -143,7 +143,7 @@ RUN touch ./ENTERPRISE_VERSION
143143
USER nobody
144144

145145
# * saas-api [api-runtime, build-python-private]
146-
FROM api-runtime as saas-api
146+
FROM --platform=$TARGETPLATFORM api-runtime as saas-api
147147

148148
# Install GnuPG and import private key
149149
RUN --mount=type=secret,id=sse_pgp_pkey \
@@ -161,7 +161,7 @@ RUN touch ./SAAS_DEPLOYMENT
161161
USER nobody
162162

163163
# * oss-api [api-runtime, build-python]
164-
FROM api-runtime as oss-api
164+
FROM --platform=$TARGETPLATFORM api-runtime as oss-api
165165

166166
COPY --from=build-python /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
167167
COPY --from=build-python /usr/local/bin /usr/local/bin
@@ -171,7 +171,7 @@ RUN python manage.py collectstatic --no-input
171171
USER nobody
172172

173173
# * oss-frontend [build-node-selfhosted]
174-
FROM node:16-slim AS oss-frontend
174+
FROM --platform=$TARGETPLATFORM node:16-slim AS oss-frontend
175175

176176
USER node
177177
WORKDIR /srv/bt
@@ -187,7 +187,7 @@ EXPOSE 8080
187187
CMD ["node", "./api/index.js"]
188188

189189
# * oss-unified [build-python, build-node-django]
190-
FROM api-runtime as oss-unified
190+
FROM --platform=$TARGETPLATFORM api-runtime as oss-unified
191191

192192
COPY --from=build-node-django /app/api/static /app/static/
193193
COPY --from=build-node-django /app/api/app/templates/webpack /app/app/templates/webpack

0 commit comments

Comments
 (0)