diff --git a/templates/dockerhub/Dockerfile b/templates/dockerhub/Dockerfile index d14b282..7495d56 100644 --- a/templates/dockerhub/Dockerfile +++ b/templates/dockerhub/Dockerfile @@ -12,7 +12,7 @@ RUN curl --output clever-tools_linux.tar.gz https://clever-tools.clever-cloud.co # Only grep the clever-tools binary and his libraries for the release stage # We use ldd to find the shared object dependencies. RUN \ - mkdir -p /tmp/fakeroot/lib && \ + mkdir -p /tmp/fakeroot/lib && \ cp $(ldd /usr/local/bin/clever | grep -o '/.\+\.so[^ ]*' | sort | uniq) /tmp/fakeroot/lib && \ for lib in /tmp/fakeroot/lib/*; do strip --strip-all $lib; done && \ mkdir -p /tmp/fakeroot/bin/ && \ @@ -28,9 +28,14 @@ LABEL version="<%= version %>" \ VOLUME ["/actions"] WORKDIR /actions -COPY --from=build /tmp/fakeroot/ / +RUN \ + ## The loader search ld-linux-x86-64.so.2 in /lib64 but the folder does not exist + ln -s lib lib64 && \ + mkdir -p /etc/ssl/certs -## The loader search ld-linux-x86-64.so.2 in /lib64 but the folder does not exist -RUN ln -s lib lib64 +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=build /tmp/fakeroot/ / +COPY --from=ghcr.io/tarampampam/curl:8.11.1 /bin/curl /usr/bin/curl +COPY --from=ghcr.io/jqlang/jq /jq /usr/bin/jq ENTRYPOINT ["clever"] diff --git a/templates/dockerhub/README.md b/templates/dockerhub/README.md index 2c2f38a..4c13d60 100644 --- a/templates/dockerhub/README.md +++ b/templates/dockerhub/README.md @@ -1,6 +1,6 @@ # Clever Tools Docker Image -This is a lightweight Docker image intended to be used mostly in CI environment. +This is a lightweight Docker image intended to be used mostly in CI environment. ## How to use diff --git a/templates/dockerhub/test/Dockerfile b/templates/dockerhub/test/Dockerfile new file mode 100644 index 0000000..dcdc912 --- /dev/null +++ b/templates/dockerhub/test/Dockerfile @@ -0,0 +1,42 @@ +# THIS IS A TEST FILE ... TO BE DELETED +FROM debian AS build + +RUN apt-get update && apt-get install -y \ + libtool \ + curl + +RUN curl --output clever-tools_linux.tar.gz https://clever-tools.clever-cloud.com/releases/3.11.0/clever-tools-3.11.0_linux.tar.gz \ + && mkdir clever-tools_linux \ + && tar xvzf clever-tools_linux.tar.gz -C clever-tools_linux --strip-components=1 \ + && cp clever-tools_linux/clever /usr/local/bin + +# Only grep the clever-tools binary and his libraries for the release stage +# We use ldd to find the shared object dependencies. +RUN \ + mkdir -p /tmp/fakeroot/lib && \ + cp $(ldd /usr/local/bin/clever | grep -o '/.\+\.so[^ ]*' | sort | uniq) /tmp/fakeroot/lib && \ + for lib in /tmp/fakeroot/lib/*; do strip --strip-all $lib; done && \ + mkdir -p /tmp/fakeroot/bin/ && \ + cp /usr/local/bin/clever /tmp/fakeroot/bin/ + +FROM busybox:glibc AS release + +LABEL version="3.11.0" \ + maintainer="<%= maintainer %>" \ + description="<%= description %>" \ + license="<%= license %>" + +VOLUME ["/actions"] +WORKDIR /actions + +RUN \ + ## The loader search ld-linux-x86-64.so.2 in /lib64 but the folder does not exist + ln -s lib lib64 && \ + mkdir -p /etc/ssl/certs + +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=build /tmp/fakeroot/ / +COPY --from=ghcr.io/tarampampam/curl:8.11.1 /bin/curl /usr/bin/curl +COPY --from=ghcr.io/jqlang/jq /jq /usr/bin/jq + +ENTRYPOINT ["sh"]