Browse Source

fix: allow build after git.0k.io web interface loss and letsencrypt SSL curl system issue

- Alpine base system move from ``3.7`` to ``3.11`` to fix the SSL issue.
- add ``diffutils`` for full blown GNU ``diff`` support
- update of ``kal-shlib-{charm,common,docker}`` versions
- replacement of ``http://git.0k.io`` by hand picked binaries in
  ``https://docker.0k.io/download``.
- some forced lib update due to alpine base version change
  - pyyaml from ``4.1`` to ``5.4.1``
- add ``yq`` and ``patch``

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
Valentin Lab 2 years ago
parent
commit
ba792b015f
  1. 52
      Dockerfile

52
Dockerfile

@ -1,8 +1,8 @@
FROM python:2-alpine3.7 as common
FROM python:2-alpine3.11 as common
CMD ["/bin/sh"]
RUN apk --no-cache --update add git bash yaml sed lsof findutils
RUN apk --no-cache --update add git bash yaml sed lsof findutils diffutils
RUN apk --no-cache --update add libxslt
@ -13,13 +13,13 @@ RUN apk --update add curl
## would love to use args... but I need it as an environment variable
ENV KAL_SHLIB_ARRAY_VERSION="0.2.0" \
KAL_SHLIB_CACHE_VERSION="0.0.1" \
KAL_SHLIB_CHARM_VERSION="0.5.1" \
KAL_SHLIB_CHARM_VERSION="0.5.3" \
KAL_SHLIB_CMDLINE_VERSION="0.0.5" \
KAL_SHLIB_COMMON_VERSION="0.4.17" \
KAL_SHLIB_COMMON_VERSION="0.4.22" \
KAL_SHLIB_CONFIG_VERSION="0.0.2" \
KAL_SHLIB_CORE_VERSION="0.7.0" \
KAL_SHLIB_FIREWALL_VERSION="0.2.0" \
KAL_SHLIB_DOCKER_VERSION="0.0.6" \
KAL_SHLIB_DOCKER_VERSION="0.0.9" \
KAL_SHLIB_OTHER_VERSION="0.2.2" \
KAL_SHLIB_PRETTY_VERSION="0.4.3"
@ -66,31 +66,33 @@ RUN apk add libffi-dev openssl-dev && \
# docker-compose==$DOCKER_COMPOSE_VERSION
# pip install git+https://github.com/vaab/colour@master
RUN curl -L https://git.0k.io/0k-charm.git/plain/bin/charm > /usr/local/bin/charm && \
chmod +x /usr/local/bin/charm
RUN curl -L https://git.0k.io/git-sub.git/plain/bin/git-sub > /usr/local/bin/git-sub && \
chmod +x /usr/local/bin/git-sub
RUN curl -L https://git.0k.io/0k-docker.git/plain/src/bin/dupd > /usr/local/bin/dupd && \
chmod +x /usr/local/bin/dupd
ENV SCRIPT_CHARM_SHA="2da0d3f" \
SCRIPT_GIT_SUB_SHA="9c1c88b" \
SCRIPT_DUPD_SHA="08c71ec" \
SCRIPT_XPATH_SHA="0.4.5"
RUN export pkg ; \
for pkg in charm git-sub dupd xpath; do \
echo "Getting $pkg..." ; \
bash -c -- 'varname=${pkg^^} ; varname=${varname//-/_} ; \
eval curl https://docker.0k.io/downloads/$pkg-\${SCRIPT_${varname^^}_SHA}' > \
/usr/local/bin/"$pkg" || exit 1 ; \
chmod +x /usr/local/bin/"$pkg" ; \
done
RUN curl http://docker.0k.io/get/ca.0k.io.pem > /usr/local/share/ca-certificates/ca.0k.io.pem
##force install pyyaml with libyaml
RUN cd /tmp && \
wget https://github.com/yaml/pyyaml/archive/4.1.tar.gz && \
tar xvzf 4.1.tar.gz && \
cd pyyaml-4.1 && \
wget https://github.com/yaml/pyyaml/archive/5.4.1.tar.gz && \
tar xvzf 5.4.1.tar.gz && \
cd pyyaml-5.4.1 && \
pip install cython==0.29.32 && \
PYTHONPATH=/usr/lib/python2.7/site-packages python setup.py --with-libyaml install
## needed by 'xpath' script from kal-scripts for parsing html output
RUN apk add libxslt-dev && \
pip install lxml==4.5.2 html5lib==1.1 webencodings==0.5.1 && \
wget "https://git.0k.io/kal-scripts.git/plain/src/bin/xpath?h=0k/dev/master&id=e04a1b7942cb39ff2515c7f666abd33bf621b119" -O /usr/local/bin/xpath && \
chmod +x /usr/local/bin/xpath
pip install lxml==4.5.2 html5lib==1.1 webencodings==0.5.1
FROM common
@ -133,6 +135,14 @@ RUN wget https://github.com/bronze1man/yaml2json/releases/download/v1.3/yaml2jso
-O /usr/local/bin/yaml2json && \
chmod +x /usr/local/bin/yaml2json
## ``yq`` will probably replace shyaml
RUN wget https://github.com/mikefarah/yq/releases/download/v4.26.1/yq_linux_amd64 \
-O /usr/local/bin/yq && \
chmod +x /usr/local/bin/yq
## handy in some charms or action to recode some output
RUN apk add patch
## Fixing Let's encrypt CA issue from 2021-10-01, probably can remove
## with newer alpine version (was added with alpine 3.7.1)
RUN sed -ri 's%^(mozilla/DST_Root_CA_X3.crt)%!\\1%g' /etc/ca-certificates.conf && \

Loading…
Cancel
Save