-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #3380 - UI asset files not properly copied to container #3381
Changes from 2 commits
ed7a9ae
0e42d69
3a131ca
baf28d4
9fea040
e67d659
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
# Mozilla Kinto server | ||
|
||
FROM node:lts-bullseye-slim as node-builder | ||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl | ||
COPY scripts/build-kinto-admin.sh . | ||
COPY /kinto/plugins/admin ./kinto/plugins/admin | ||
RUN bash build-kinto-admin.sh | ||
|
||
FROM python:3.10-slim-bullseye as python-builder | ||
RUN python -m venv /opt/venv | ||
RUN apt-get update && apt-get install -y --no-install-recommends build-essential libpq-dev | ||
RUN apt-get update && apt-get install -y --no-install-recommends build-essential libpq-dev ca-certificates curl | ||
ARG KINTO_VERSION=1 | ||
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_KINTO=${KINTO_VERSION} \ | ||
PATH="/opt/venv/bin:$PATH" | ||
# At this stage we only fetch and build all dependencies. | ||
WORKDIR /pkg-kinto | ||
COPY constraints.txt . | ||
COPY pyproject.toml . | ||
COPY constraints.txt pyproject.toml MANIFEST.in ./ | ||
COPY kinto/ kinto/ | ||
|
||
COPY scripts/pull-kinto-admin.sh . | ||
RUN bash pull-kinto-admin.sh | ||
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be nice to find a way to do this before we Maybe we can pull kinto admin an earlier layer, then copy the files to the right place after we copy the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made a change to do that, but it's a little janky because it's working around a circular dependency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, you can leave it for now then -- since we're just curling, it's much faster that having to do a whole build step. |
||
|
||
RUN pip install --upgrade pip && \ | ||
pip install ".[postgresql,memcached,monitoring]" -c constraints.txt && \ | ||
pip install kinto-attachment kinto-emailer httpie | ||
|
@@ -27,7 +23,6 @@ RUN groupadd --gid 10001 app && \ | |
useradd --uid 10001 --gid 10001 --home /app --create-home app | ||
|
||
COPY --from=python-builder /opt/venv /opt/venv | ||
COPY --from=node-builder /kinto/plugins/admin/build ./kinto/plugins/admin/build | ||
|
||
ENV KINTO_INI=/etc/kinto/kinto.ini \ | ||
PORT=8888 \ | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1 @@ | ||||||
recursive-include kinto/plugins/admin/build * | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now managed here Lines 54 to 55 in b67c6c3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, that explains why the index.html file was showing up but nothing else. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.0.1 | ||
3.0.3 |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||||
#!/bin/bash | ||||||
set -euo pipefail | ||||||
|
||||||
VERSION=$(cat kinto/plugins/admin/VERSION) | ||||||
TAG="v${VERSION}" | ||||||
|
||||||
echo $PWD | ||||||
|
||||||
# download and unzip release | ||||||
curl -OL https://github.com/Kinto/kinto-admin/releases/download/${TAG}/kinto-admin-release.tar | ||||||
rm -r ./kinto/plugins/admin/build || echo "admin/build folder doesn't exist yet" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Or is this too dangerous? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this script was only used for docker I'd be fine with the |
||||||
mkdir ./kinto/plugins/admin/build | ||||||
tar -xf kinto-admin-release.tar -C ./kinto/plugins/admin/build && rm kinto-admin-release.tar | ||||||
echo $VERSION > ./kinto/plugins/admin/build/VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the base container to
FROM python:3.10
instead? That way we can get rid of this entire line.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, makes building faster too.