Update alpine Docker tag to v3.17 (develop)
This commit is contained in:
parent
9d84423732
commit
abfa971eb5
|
@ -107,7 +107,7 @@ review_docs:
|
||||||
|
|
||||||
changelog_snippet:
|
changelog_snippet:
|
||||||
interruptible: true
|
interruptible: true
|
||||||
image: alpine:3.16
|
image: alpine:3.17
|
||||||
stage: lint
|
stage: lint
|
||||||
before_script:
|
before_script:
|
||||||
- apk add git
|
- apk add git
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM alpine:3.16 as pre-build
|
FROM alpine:3.17 as pre-build
|
||||||
|
|
||||||
# We need this additional step to avoid having poetrys deps interacting with our
|
# We need this additional step to avoid having poetrys deps interacting with our
|
||||||
# dependencies. This is only required until alpine 3.16 is released, since this
|
# dependencies. This is only required until alpine 3.16 is released, since this
|
||||||
|
@ -7,10 +7,10 @@ FROM alpine:3.16 as pre-build
|
||||||
RUN apk add --no-cache python3 py3-cryptography py3-pip poetry
|
RUN apk add --no-cache python3 py3-cryptography py3-pip poetry
|
||||||
COPY pyproject.toml poetry.lock /
|
COPY pyproject.toml poetry.lock /
|
||||||
RUN poetry export --without-hashes > requirements.txt
|
RUN poetry export --without-hashes > requirements.txt
|
||||||
RUN poetry export --dev --without-hashes > dev-requirements.txt
|
RUN poetry export --with dev --without-hashes > dev-requirements.txt
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:3.16 as builder
|
FROM alpine:3.17 as builder
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
echo 'installing dependencies' && \
|
echo 'installing dependencies' && \
|
||||||
|
@ -22,6 +22,8 @@ RUN \
|
||||||
python3-dev \
|
python3-dev \
|
||||||
py3-psycopg2 \
|
py3-psycopg2 \
|
||||||
py3-cryptography \
|
py3-cryptography \
|
||||||
|
py3-lxml \
|
||||||
|
py3-pillow \
|
||||||
libldap \
|
libldap \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
make \
|
make \
|
||||||
|
@ -32,9 +34,7 @@ RUN \
|
||||||
cargo \
|
cargo \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
libxslt-dev \
|
libxslt-dev \
|
||||||
curl \
|
curl
|
||||||
&& \
|
|
||||||
ln -s /usr/bin/python3 /usr/bin/python
|
|
||||||
|
|
||||||
# create virtual env for next stage
|
# create virtual env for next stage
|
||||||
RUN python -m venv --system-site-packages /venv
|
RUN python -m venv --system-site-packages /venv
|
||||||
|
@ -53,21 +53,21 @@ RUN \
|
||||||
# is why we need to use the packages shipped by Alpine Linux.
|
# is why we need to use the packages shipped by Alpine Linux.
|
||||||
# Since poetry does not allow in-place dependency pinning, we need
|
# Since poetry does not allow in-place dependency pinning, we need
|
||||||
# to install the deps using pip.
|
# to install the deps using pip.
|
||||||
grep -Ev 'cryptography|uvicorn|watchgod|watchfiles' /requirements.txt | pip3 install -r /dev/stdin cryptography==3.4.8 uvicorn==0.17.6 watchgod==0.8.2 && \
|
grep -Ev 'cryptography|uvicorn|watchgod|watchfiles|lxml|pillow' /requirements.txt | pip3 install -r /dev/stdin cryptography==38.0.3 uvicorn==0.17.6 watchgod==0.8.2 lxml==4.9.1 pillow==9.3.0 && \
|
||||||
rm -rf "$PIP_DOWNLOAD_CACHE"
|
rm -rf "$PIP_DOWNLOAD_CACHE"
|
||||||
|
|
||||||
ARG install_dev_deps=0
|
ARG install_dev_deps=0
|
||||||
RUN \
|
RUN \
|
||||||
if [ "$install_dev_deps" = "1" ] ; then \
|
if [ "$install_dev_deps" = "1" ] ; then \
|
||||||
echo "Installing dev dependencies" && \
|
echo "Installing dev dependencies" && \
|
||||||
grep -Ev 'cryptography|uvicorn|watchgod|watchfiles' /dev-requirements.txt | pip3 install -r /dev/stdin cryptography==3.4.8 uvicorn==0.17.6 watchgod==0.8.2 && \
|
grep -Ev 'cryptography|uvicorn|watchgod|watchfiles|lxml|pillow' /dev-requirements.txt | pip3 install -r /dev/stdin cryptography==38.0.3 uvicorn==0.17.6 watchgod==0.8.2 lxml==4.9.1 pillow==9.3.0 && \
|
||||||
rm -rf "$PIP_DOWNLOAD_CACHE" \
|
rm -rf "$PIP_DOWNLOAD_CACHE" \
|
||||||
; else \
|
; else \
|
||||||
echo "Skipping dev deps installation" \
|
echo "Skipping dev deps installation" \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:3.16 as image
|
FROM alpine:3.17 as image
|
||||||
|
|
||||||
COPY --from=builder /venv /venv
|
COPY --from=builder /venv /venv
|
||||||
# emulate activation by prefixing PATH
|
# emulate activation by prefixing PATH
|
||||||
|
@ -84,9 +84,9 @@ RUN apk add --no-cache \
|
||||||
libxml2 \
|
libxml2 \
|
||||||
libxslt \
|
libxslt \
|
||||||
py3-cryptography \
|
py3-cryptography \
|
||||||
libldap \
|
py3-lxml \
|
||||||
&& \
|
py3-pillow \
|
||||||
ln -s /usr/bin/python3 /usr/bin/python
|
libldap
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Upgrade docker base image to alpine 3.17
|
Loading…
Reference in New Issue