From fdfb68b3afe2f3922f02b9aecc9d5eff60463583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Gr=C4=85dzki?= Date: Thu, 18 Apr 2024 14:45:57 +0200 Subject: [PATCH] replace wget with curl + fail on errors while retrieving remote assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Przemysław Grądzki --- Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5fdf35aa..e9ffaf5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,8 +50,7 @@ RUN install -dv -m0755 /publisher && install -dv -g 65534 -m0775 "${TMPDIR}" && RUN \ echo ================================= install basics >&2 && \ apk --no-cache add \ - curl wget \ - bash git grep sed findutils coreutils tree jq yq bc xmlstarlet util-linux \ + bash curl git grep sed findutils coreutils tree jq yq bc xmlstarlet util-linux \ zip tar xz \ openjdk21 \ python3-dev py3-pip py3-wheel py3-cachetools py3-frozendict py3-isodate py3-lxml cython py3-pandas \ @@ -80,7 +79,7 @@ RUN \ targz="${name}.tar.gz" ; \ url="http://archive.apache.org/dist/jena/binaries/${targz}" ; \ echo "Downloading ${url}:" >&2 ; \ - curl --location --silent --show-error --output /var/tmp/${targz} --url "${url}" && \ + curl -f --remote-time --location --silent --show-error --output /var/tmp/${targz} --url "${url}" && \ install -d "$(dirname "${JENA_HOME}")" && cd "$(dirname "${JENA_HOME}")" && \ tar xzpf /var/tmp/${targz} && \ rm -f /var/tmp/${targz} && \ @@ -103,8 +102,8 @@ RUN \ # ENV ROBOT_VERSION="v1.9.5" RUN \ - wget -m -nH -nd -P /usr/local/bin https://raw.githubusercontent.com/ontodev/robot/${ROBOT_VERSION:-master}/bin/robot && \ - wget -m -nH -nd -P /usr/local/bin https://github.com/ontodev/robot/releases/${ROBOT_VERSION:+download/}${ROBOT_VERSION:=latest/download}/robot.jar && \ + curl -f --remote-time --location --silent --show-error --output /usr/local/bin/robot https://raw.githubusercontent.com/ontodev/robot/${ROBOT_VERSION:-master}/bin/robot && \ + curl -f --remote-time --location --silent --show-error --output /usr/local/bin/robot.jar https://github.com/ontodev/robot/releases/${ROBOT_VERSION:+download/}${ROBOT_VERSION:=latest/download}/robot.jar && \ chmod +x /usr/local/bin/robot COPY etc /etc @@ -114,7 +113,8 @@ COPY root /root # Installing [shacler](https://github.com/edmcouncil/tools/) # RUN \ - wget -m -nH -nd -P /publisher/lib https://raw.githubusercontent.com/edmcouncil/tools/develop/shacl/shacler.py + install -dv /publisher/lib && \ + curl -f --remote-time --location --silent --show-error --output /publisher/lib/shacler.py https://raw.githubusercontent.com/edmcouncil/tools/develop/shacl/shacler.py # # Installing [rdf-toolkit](https://github.com/edmcouncil/rdf-toolkit) @@ -131,7 +131,7 @@ RUN \ rdftoolkit_url="https://github.com/edmcouncil/rdf-toolkit/releases/${RDFTOOLKIT_VERSION:+download/}${RDFTOOLKIT_VERSION:=latest/download}/rdf-toolkit.jar" ; \ mkdir -p /usr/share/java/rdf-toolkit ; \ echo "Downloading ${rdftoolkit_url}:" >&2 ; \ - curl --location --silent --show-error --output ${RDFTOOLKIT_JAR} --url "${rdftoolkit_url}" + curl -f --remote-time --location --silent --show-error --output ${RDFTOOLKIT_JAR} --url "${rdftoolkit_url}" # # Install OntoViewer Toolkit @@ -142,7 +142,7 @@ RUN \ url='https://jenkins.edmcouncil.org/view/onto-viewer/job/onto-viewer-publish/lastSuccessfulBuild/artifact/onto-viewer-toolkit/target/onto-viewer-toolkit.jar' ; \ mkdir -p /usr/share/java/onto-viewer ; \ echo "Downloading ${url}:" >&2 ; \ - curl --location --silent --show-error --output "${ONTOVIEWER_TOOLKIT_JAR}" --url "${url}" + curl -f --remote-time --location --silent --show-error --output "${ONTOVIEWER_TOOLKIT_JAR}" --url "${url}" # # @@ -178,7 +178,7 @@ RUN \ sed -i "s//${ONTPUB_FAMILY}/g ; s//${HYGIENE_TEST_PARAMETER_VALUE}/g ; s//${ONTPUB_IS_DARK_MODE}/g" /etc/bashrc && \ ln -sf /var/tmp/.gitconfig /root/.gitconfig && \ ln -sf /var/tmp/.gitconfig /.gitconfig && \ - rm -rvf /root/{.wget-hsts,.cache} + rm -rvf /root/.cache CMD ["./publish.sh"]