This repository has been archived on 2024-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
stagex/curl/Dockerfile

53 lines
1.5 KiB
Docker
Raw Normal View History

2023-12-10 18:05:50 +00:00
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/openssl:latest as openssl
FROM ${REGISTRY}/ca-certificates:latest as ca-certificates
2023-12-16 23:50:40 +00:00
FROM ${REGISTRY}/busybox:latest as busybox
2023-11-19 07:38:16 +00:00
2023-12-16 23:50:40 +00:00
FROM busybox as base
2023-11-19 07:38:16 +00:00
ENV SRC_SITE=https://curl.se/download
ENV SRC_VERSION=8.4.0
ENV SRC_HASH=16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=gcc . /
COPY --from=openssl . /
2023-12-16 23:50:40 +00:00
FROM base as fetch
RUN wget ${SRC_SITE}/curl-${SRC_VERSION}.tar.xz
RUN echo "${SRC_HASH} curl-${SRC_VERSION}.tar.xz" | sha256sum -c
FROM fetch as build
RUN tar -xf curl-${SRC_VERSION}.tar.xz
WORKDIR curl-${SRC_VERSION}
2023-11-19 07:38:16 +00:00
RUN set -eux; \
./configure \
--build=x86_64-linux-musl \
--host=x86_64-linux-musl \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
--with-openssl \
--enable-static-link; \
make
2023-12-16 23:50:40 +00:00
FROM build as install
USER 0:0
RUN make install DESTDIR=/rootfs
COPY --from=musl . /rootfs/
COPY --from=openssl . /rootfs/
COPY --from=ca-certificates . /rootfs/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
2023-11-19 07:38:16 +00:00
2023-12-12 17:45:39 +00:00
FROM scratch as package
2023-12-16 23:50:40 +00:00
COPY --from=install /rootfs /
2023-11-19 07:38:16 +00:00
USER 100:100
ENTRYPOINT ["/usr/bin/curl"]
CMD ["--version"]