diff --git a/Others/apr-util/1.6.3/24.03-lts-sp1/Dockerfile b/Others/apr-util/1.6.3/24.03-lts-sp1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b64dfb9b56d934ca09af05f283779f48d527dce6 --- /dev/null +++ b/Others/apr-util/1.6.3/24.03-lts-sp1/Dockerfile @@ -0,0 +1,40 @@ +ARG BASE=openeuler/openeuler:24.03-lts-sp1 +FROM ${BASE} as BUILDER +ARG VERSION=1.6.3 +ARG APR_VERSION=1.7.6 + +RUN dnf update -y && \ + dnf install -y \ + wget \ + gcc \ + make \ + libtool \ + pkg-config \ + expat-devel \ + && dnf clean all \ + && rm -rf /var/cache/dnf + +WORKDIR /opt + +RUN wget https://dlcdn.apache.org/apr/apr-${APR_VERSION}.tar.gz \ + && tar -zxvf apr-${APR_VERSION}.tar.gz \ + && cd apr-${APR_VERSION} \ + && ./configure --prefix=/usr/local/apr \ + && make -j$(nproc) \ + && make install \ + && cd .. \ + && rm -rf apr-${APR_VERSION}* + +RUN wget https://dlcdn.apache.org/apr/apr-util-${VERSION}.tar.gz \ + && tar -zxvf apr-util-${VERSION}.tar.gz \ + && cd apr-util-${VERSION} \ + && ./configure --prefix=/usr/local/apr --with-apr=/usr/local/apr \ + && make -j$(nproc) \ + && make install \ + && cd .. \ + && rm -rf apr-util-${VERSION}* + +ENV LD_LIBRARY_PATH=/usr/local/apr/lib:$LD_LIBRARY_PATH +ENV PKG_CONFIG_PATH=/usr/local/apr/lib/pkgconfig:$PKG_CONFIG_PATH + +CMD ["/usr/local/apr/bin/apu-1-config", "--version"] \ No newline at end of file diff --git a/Others/apr-util/1.7.6/24.03-lts-sp1/Dockerfile b/Others/apr-util/1.7.6/24.03-lts-sp1/Dockerfile deleted file mode 100644 index 75e67ae082d269ecf42c729240e4e3ed8aad483f..0000000000000000000000000000000000000000 --- a/Others/apr-util/1.7.6/24.03-lts-sp1/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -ARG BASE=openeuler/openeuler:24.03-lts-sp1 -FROM ${BASE} as BUILDER -ARG VERSION=1.7.6 - -RUN dnf update -y && \ - dnf install -y \ - wget \ - gcc \ - make \ - libtool \ - && dnf clean all \ - && rm -rf /var/cache/dnf/* - -WORKDIR /opt - -RUN wget https://dlcdn.apache.org/apr/apr-${VERSION}.tar.gz \ - && tar -zxvf apr-${VERSION}.tar.gz \ - && rm -f apr-${VERSION}.tar.gz - -WORKDIR /opt/apr-${VERSION} - -RUN ./configure \ - && make -j$(nproc) \ - && make install - -CMD ["/usr/local/apr/bin/apr-1-config"] diff --git a/Others/apr-util/README.md b/Others/apr-util/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e6ace332c054f7a8c0db97bacc4bd96edb07f34b --- /dev/null +++ b/Others/apr-util/README.md @@ -0,0 +1,83 @@ +# Quick reference + +- The official APR-util (Apache Portable Runtime Utilities) docker image. + +- Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative). + +- Where to get help: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative), [openEuler](https://gitee.com/openeuler/community). + +# APR-util (Apache Portable Runtime Utilities) | openEuler +Current APR-util (Apache Portable Runtime Utilities) docker images are built on the [openEuler](https://repo.openeuler.org/). This repository is free to use and exempted from per-user rate limits. + +APR-util (Apache Portable Runtime Utilities) is an extension library for APR (Apache Portable Runtime), providing additional cross-platform utility functions to complement APR's core features. + +Learn more about APR-util on [APR-util Website](https://apr.apache.org/)⁠. + +# Supported tags and respective Dockerfile links +The tag of each `apr-util` docker image is consist of the version of `apr-util` and the version of basic image. The details are as follows + +| Tag | Currently | Architectures | +|----------|-------------|------------------| +|[1.6.3-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/apr-util/1.6.3/24.03-lts-sp1/Dockerfile)| APR-util 1.6.3 on openEuler 24.03-LTS-SP1 | amd64, arm64 | + +# Usage +In this usage, users can select the corresponding `{Tag}` based on their requirements. + +- Pull the `openeuler/apr-util` image from docker + + ```bash + docker pull openeuler/apr-util:{Tag} + ``` + +- Run with an interactive shell + + You can start the container with an interactive shell to run your own code using APR-util. + ``` + docker run -it --rm openeuler/apr-util:{Tag} bash + ``` + +- Example: A minimal APR-util program + + Create a file named `parse.c` with the following content: + ``` + // parse.c + #include + #include + #include + + int main() { + apr_initialize(); + apr_pool_t *pool; + apr_pool_create(&pool, NULL); + + apr_uri_t uri; + const char *url = "http://example.com/path?key=value"; + + if (apr_uri_parse(pool, url, &uri) == APR_SUCCESS) { + printf("Host: %s\n", uri.hostname); + } else { + printf("Parse failed\n"); + } + + apr_pool_destroy(pool); + apr_terminate(); + return 0; + } + ``` + +- Compile the program: + ``` + gcc parse.c -o parse \ + -I/usr/local/apr/include/apr-1 \ + -I/usr/include/apr-util-1 \ + -L/usr/local/apr/lib \ + -lapr-1 -laprutil-1 + ``` + +- Run the program + ``` + $ ./parse + ``` + +# Question and answering +If you have any questions or want to use some special features, please submit an issue or a pull request on [openeuler-docker-images](https://gitee.com/openeuler/openeuler-docker-images). \ No newline at end of file diff --git a/Others/apr-util/doc/image-info.yml b/Others/apr-util/doc/image-info.yml new file mode 100644 index 0000000000000000000000000000000000000000..6348fa23985fe991c15587b4d0a8a8255300b509 --- /dev/null +++ b/Others/apr-util/doc/image-info.yml @@ -0,0 +1,79 @@ +name: apr-util +category: others +description: APR-util(Apache Portable Runtime Utility)是APR(Apache Portable Runtime)的扩展工具库。 +environment: | + 本应用在Docker环境中运行,安装Docker执行如下命令 + ``` + yum install -y docker + ``` +tags: | + apr-util镜像的Tag由其版本信息和基础镜像版本信息组成,详细内容如下 + + | Tag | Currently | Architectures | + |----------|-------------|------------------| + |[1.6.3-oe2403sp1](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/apr-util/1.6.3/24.03-lts-sp1/Dockerfile)| APR-util 1.6.3 on openEuler 24.03-LTS-SP1 | amd64, arm64 | + +download: | + 拉取镜像到本地 + ``` + docker pull openeuler/apr-util:{Tag} + ``` + +usage: | + - 使用交互式Shell运行: + + 启动一个带交互式Shell的容器,使用apr-util运行自己的代码。 + ``` + docker run -it --rm openeuler/apr-util:{Tag} bash + ``` + + - 一个简单的使用示例 + + 创建`parse.c`文件,内容如下: + ``` + // parse.c + #include + #include + #include + + int main() { + apr_initialize(); + apr_pool_t *pool; + apr_pool_create(&pool, NULL); + + apr_uri_t uri; + const char *url = "http://example.com/path?key=value"; + + if (apr_uri_parse(pool, url, &uri) == APR_SUCCESS) { + printf("Host: %s\n", uri.hostname); + } else { + printf("Parse failed\n"); + } + + apr_pool_destroy(pool); + apr_terminate(); + return 0; + } + ``` + + - 编译程序: + ``` + gcc parse.c -o parse \ + -I/usr/local/apr/include/apr-1 \ + -I/usr/include/apr-util-1 \ + -L/usr/local/apr/lib \ + -lapr-1 -laprutil-1 + ``` + + - 运行程序 + ``` + $ ./parse + ``` + +license: Apache-2.0 +similar_packages: + - N/A +dependency: + - apr + - expat + - openssl diff --git a/Others/apr-util/doc/picture/logo.png b/Others/apr-util/doc/picture/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ec63471a40420c026c41032817730e6787921739 Binary files /dev/null and b/Others/apr-util/doc/picture/logo.png differ diff --git a/Others/apr-util/meta.yml b/Others/apr-util/meta.yml index a67abd76f6e7ee7f1c80383e2dc25cd535e67e5c..a0e1fdc737585e81fec7430bac8ec362e7afc334 100644 --- a/Others/apr-util/meta.yml +++ b/Others/apr-util/meta.yml @@ -1,2 +1,2 @@ -1.7.6-oe2403sp1: - path: 1.7.6/24.03-lts-sp1/Dockerfile +1.6.3-oe2403sp1: + path: 1.6.3/24.03-lts-sp1/Dockerfile