Update Monasca Base Image

- Bump base image to python:3.8-alpine3.15
- Add Rust compiler and its dependency Cairo
- Bump librdkafka to v1.8.0
- Removed env variable CRYPTOGRAPHY_DONT_BUILD_RUST=1 since
  new Cryptography requires Rust.

Change-Id: Iacb7d3b5eeb1540647c189d76cf5aa3dee9706b5
This commit is contained in:
Martin Chacon Piza 2022-01-25 18:30:14 +01:00
parent d6ebd62a6d
commit ffce75af6c

View File

@ -1,4 +1,4 @@
FROM python:3.6.8-alpine3.9 FROM python:3.8-alpine3.15
COPY wait_for.sh kafka_wait_for_topics.py mysql_check.py / COPY wait_for.sh kafka_wait_for_topics.py mysql_check.py /
COPY ashrc /root/.ashrc COPY ashrc /root/.ashrc
@ -7,8 +7,7 @@ ENV \
ENV="/root/.ashrc" \ ENV="/root/.ashrc" \
PIP_NO_CACHE_DIR="no" \ PIP_NO_CACHE_DIR="no" \
PIP_NO_COMPILE="no" \ PIP_NO_COMPILE="no" \
PYTHONIOENCODING="utf-8" \ PYTHONIOENCODING="utf-8"
CRYPTOGRAPHY_DONT_BUILD_RUST=1
ARG BASE_CREATION_TIME ARG BASE_CREATION_TIME
ARG BASE_GIT_COMMIT ARG BASE_GIT_COMMIT
@ -72,6 +71,7 @@ ONBUILD SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
ONBUILD RUN \ ONBUILD RUN \
chmod +x /start.sh && \ chmod +x /start.sh && \
apk add --no-cache --virtual .build-deps \ apk add --no-cache --virtual .build-deps \
cairo \
g++ \ g++ \
git \ git \
libffi-dev \ libffi-dev \
@ -79,8 +79,9 @@ ONBUILD RUN \
libxml2-dev \ libxml2-dev \
libxslt-dev \ libxslt-dev \
linux-headers \ linux-headers \
make && \ make \
# For librdkafka bigger than v1.6.0 we need newer versions of some rust && \
# For librdkafka bigger than v1.8.0 we need newer versions of some
# libraries. # libraries.
apk add --no-cache --virtual .build-librdkafka \ apk add --no-cache --virtual .build-librdkafka \
libressl3.4-libcrypto \ libressl3.4-libcrypto \
@ -89,8 +90,8 @@ ONBUILD RUN \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/community && \ --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community && \
# Install librdkafka from source code. # Install librdkafka from source code.
apk add --no-cache curl bash && \ apk add --no-cache curl bash && \
curl https://codeload.github.com/edenhill/librdkafka/tar.gz/v1.6.0 | tar xzf - -C /tmp/ && \ curl https://codeload.github.com/edenhill/librdkafka/tar.gz/v1.8.0 | tar xzf - -C /tmp/ && \
cd /tmp/librdkafka-1.6.0/ && \ cd /tmp/librdkafka-1.8.0/ && \
./configure && \ ./configure && \
make && \ make && \
make install && \ make install && \