From 071c3d41f113c33a6f4f84606f92abd86e8d2176 Mon Sep 17 00:00:00 2001 From: Sergiy Markin Date: Tue, 4 Feb 2025 01:58:44 +0000 Subject: [PATCH] Preset Git safe.directory property This change ensures that Git will consider all directories as safe within the container. Also switched to libyaml-dev package 0.2.2 instead of built from source 0.2.5 Change-Id: I2c161b8504ad9c401531fd3fdcb121eafa633dd7 --- bindep.txt | 4 ++- entrypoint.sh | 3 +++ images/pegleg/Dockerfile.ubuntu_jammy | 36 +++++++++++++++++---------- tox.ini | 6 +++-- 4 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 entrypoint.sh diff --git a/bindep.txt b/bindep.txt index 180ff05e..24142256 100644 --- a/bindep.txt +++ b/bindep.txt @@ -7,4 +7,6 @@ libpq-dev [platform:dpkg] libsasl2-dev [platform:dpkg] libssl-dev [platform:dpkg] libre2-dev [platform:dpkg] -libzmq3-dev [platform:dpkg] \ No newline at end of file +libzmq3-dev [platform:dpkg] +libyaml-dev [platform:dpkg] +golang-cfssl [platform:dpkg] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..5f8d15b1 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash +git config --global --add safe.directory "*" +exec "$@" \ No newline at end of file diff --git a/images/pegleg/Dockerfile.ubuntu_jammy b/images/pegleg/Dockerfile.ubuntu_jammy index a237fb9c..d4c43af3 100644 --- a/images/pegleg/Dockerfile.ubuntu_jammy +++ b/images/pegleg/Dockerfile.ubuntu_jammy @@ -42,6 +42,10 @@ RUN set -ex \ python3-dev \ python3-pip \ python3-setuptools \ + # this will install libyaml 0.2.22 in Jammy + libyaml-dev \ + # this will install golang-cfssl 1.2.0 in Jammy + golang-cfssl \ && python3 -m pip install -U pip \ && apt autoremove -yqq --purge \ && apt clean \ @@ -56,17 +60,17 @@ RUN set -ex \ ENV LD_LIBRARY_PATH=/usr/local/lib -ARG LIBYAML_VERSION=0.2.5 -RUN set -ex \ - && git clone https://github.com/yaml/libyaml.git \ - && cd libyaml \ - && git checkout $LIBYAML_VERSION \ - && ./bootstrap \ - && ./configure \ - && make \ - && make install \ - && cd .. \ - && rm -fr libyaml +# ARG LIBYAML_VERSION=0.2.5 +# RUN set -ex \ +# && git clone https://github.com/yaml/libyaml.git \ +# && cd libyaml \ +# && git checkout $LIBYAML_VERSION \ +# && ./bootstrap \ +# && ./configure \ +# && make \ +# && make install \ +# && cd .. \ +# && rm -fr libyaml VOLUME /var/pegleg WORKDIR /var/pegleg @@ -77,8 +81,14 @@ RUN pip3 install -r https://opendev.org/airship/deckhand/raw/${DECKHAND_VERSION} && pip3 install -r https://opendev.org/airship/shipyard/raw/${SHIPYARD_VERSION}/src/bin/shipyard_client/requirements-frozen.txt \ && pip3 install --no-cache-dir -r /opt/pegleg/requirements.txt -COPY tools/install-cfssl.sh /opt/pegleg/tools/install-cfssl.sh -RUN /opt/pegleg/tools/install-cfssl.sh ${CFSSLURL} +# COPY tools/install-cfssl.sh /opt/pegleg/tools/install-cfssl.sh +# RUN /opt/pegleg/tools/install-cfssl.sh ${CFSSLURL} COPY . /opt/pegleg RUN pip3 install -e /opt/pegleg --use-pep517 + +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +CMD ["pegleg", "--help"] \ No newline at end of file diff --git a/tox.ini b/tox.ini index 81001cde..d9cf8282 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,8 @@ allowlist_externals = find commands = find . -type f -name "*.pyc" -delete - bash -c "{toxinidir}/tools/install-cfssl.sh" + # moved into bindep.txt + # bash -c "{toxinidir}/tools/install-cfssl.sh" bash -c "{toxinidir}/tools/gate/run-unit-tests.sh '{posargs}'" @@ -86,7 +87,8 @@ commands = basepython = python3 commands = find . -type f -name "*.pyc" -delete - bash -c "{toxinidir}/tools/install-cfssl.sh" + # moved into bindep.txt + # bash -c "{toxinidir}/tools/install-cfssl.sh" bash -c "{toxinidir}/tools/gate/run-cover-tests.sh '{posargs}'" allowlist_externals = bash