open-telemetry / opentelemetry-cpp-contrib

https://opentelemetry.io/
Apache License 2.0
123 stars 137 forks source link

Downloading apache related dependencies of otel-webserver-module becomes `not found` #256

Closed pddg closed 1 year ago

pddg commented 1 year ago

Describe your environment

Steps to reproduce

Clone the repository and checkout webserver/v1.0.3, then run docker build.

git clone https://github.com/open-telemetry/opentelemetry-cpp-contrib
cd opentelemetry-cpp-contrib
git checkout webserver/v1.0.3
cd instrumentation/otel-webserver-module/
docker buildx build -t otel-webserver-module-test -f docker/ubuntu20.04/Dockerfile . --load

What is the expected behavior?

Successfully build the module.

What is the actual behavior?

It has failed due to the lack of an archive of APR, whose version is 1.7.0.

❯ docker buildx build -t otel-webserver-module-test -f docker/ubuntu20.04/Dockerfile . --load
[+] Building 1.6s (11/28)                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                   0.0s
 => => transferring dockerfile: 10.67kB                                                                                                                0.0s
 => [internal] load .dockerignore                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                        0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                        1.3s
 => [ 1/24] FROM docker.io/library/ubuntu:20.04@sha256:b33325a00c7c27b23ae48cf17d2c654e2c30812b35e7846c006389318f6a71c2                                0.0s
 => => resolve docker.io/library/ubuntu:20.04@sha256:b33325a00c7c27b23ae48cf17d2c654e2c30812b35e7846c006389318f6a71c2                                  0.0s
 => [internal] load build context                                                                                                                      0.0s
 => => transferring context: 336.68kB                                                                                                                  0.0s
 => CACHED [ 2/24] RUN apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade                                                              0.0s
 => CACHED [ 3/24] RUN apt-get install -qq -y --ignore-missing  build-essential                       curl                            git              0.0s
 => CACHED [ 4/24] RUN apt-get install -y     lcov        m4                                          autoconf                                    aut  0.0s
 => CACHED [ 5/24] RUN git clone --shallow-submodules --depth 1 --recurse-submodules -b v1.36.4   https://github.com/grpc/grpc   && cd grpc   && mkdi  0.0s
 => CACHED [ 6/24] RUN mkdir -p dependencies/opentelemetry/1.2.0/lib     && mkdir -p dependencies/opentelemetry/1.2.0/include     && git clone https:  0.0s
 => ERROR [ 7/24] RUN mkdir -p dependencies/apr/1.7.0     && wget https://dlcdn.apache.org//apr/apr-1.7.0.tar.gz --no-check-certificate     && tar -x  0.1s
------
 > [ 7/24] RUN mkdir -p dependencies/apr/1.7.0     && wget https://dlcdn.apache.org//apr/apr-1.7.0.tar.gz --no-check-certificate     && tar -xf apr-1.7.0.tar.gz     && cd apr-1.7.0     && ./configure --prefix=/dependencies/apr/1.7.0 --enable-static=yes --enable-shared=no --with-pic && echo $?     && make -j 6     && make install     && cd ../ && rm -rf apr-1.7.0 && rm -rf apr-1.7.0.tar.gz:
#0 0.067 --2023-02-01 03:19:59--  https://dlcdn.apache.org//apr/apr-1.7.0.tar.gz
#0 0.068 Resolving dlcdn.apache.org (dlcdn.apache.org)... 151.101.2.132, 2a04:4e42::644
#0 0.074 Connecting to dlcdn.apache.org (dlcdn.apache.org)|151.101.2.132|:443... connected.
#0 0.082 HTTP request sent, awaiting response... 404 Not Found
#0 0.087 2023-02-01 03:19:59 ERROR 404: Not Found.
#0 0.087 
------
Dockerfile:85
--------------------
  84 |     #install Apr
  85 | >>> RUN mkdir -p dependencies/apr/${APR_VERSION} \
  86 | >>>     && wget https://dlcdn.apache.org//apr/apr-${APR_VERSION}.tar.gz --no-check-certificate \
  87 | >>>     && tar -xf apr-${APR_VERSION}.tar.gz \
  88 | >>>     && cd apr-${APR_VERSION} \
  89 | >>>     && ./configure --prefix=/dependencies/apr/${APR_VERSION} --enable-static=yes --enable-shared=no --with-pic && echo $? \
  90 | >>>     && make -j 6 \
  91 | >>>     && make install \
  92 | >>>     && cd ../ && rm -rf apr-${APR_VERSION} && rm -rf apr-${APR_VERSION}.tar.gz
  93 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c mkdir -p dependencies/apr/${APR_VERSION}     && wget https://dlcdn.apache.org//apr/apr-${APR_VERSION}.tar.gz --no-check-certificate     && tar -xf apr-${APR_VERSION}.tar.gz     && cd apr-${APR_VERSION}     && ./configure --prefix=/dependencies/apr/${APR_VERSION} --enable-static=yes --enable-shared=no --with-pic && echo $?     && make -j 6     && make install     && cd ../ && rm -rf apr-${APR_VERSION} && rm -rf apr-${APR_VERSION}.tar.gz" did not complete successfully: exit code: 8

Additional context

https://apr.apache.org/index.html

APR 1.7.1, released January 31, 2023 APR-util 1.6.2, released Jaunary 31, 2023

New version of APR and APR-util are released at January 31, 2023. After that, the archive of older versions seems to have disappeared from dlcdn.apache.org/apr .

It may be better to download these archives from the website https://archive.apache.org/dist/apr/ .