Skip to content

Commit f165509

Browse files
committed
feat(docker): add curl and jq binaries
This is the work of @chmuche CleverCloud/clever-tools-dockerhub#6 but applied on the dockertemplate
1 parent 776e024 commit f165509

File tree

3 files changed

+45
-5
lines changed

3 files changed

+45
-5
lines changed

templates/dockerhub/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN curl --output clever-tools_linux.tar.gz https://clever-tools.clever-cloud.co
1212
# Only grep the clever-tools binary and his libraries for the release stage
1313
# We use ldd to find the shared object dependencies.
1414
RUN \
15-
mkdir -p /tmp/fakeroot/lib && \
15+
mkdir -p /tmp/fakeroot/lib && \
1616
cp $(ldd /usr/local/bin/clever | grep -o '/.\+\.so[^ ]*' | sort | uniq) /tmp/fakeroot/lib && \
1717
for lib in /tmp/fakeroot/lib/*; do strip --strip-all $lib; done && \
1818
mkdir -p /tmp/fakeroot/bin/ && \
@@ -28,9 +28,11 @@ LABEL version="<%= version %>" \
2828
VOLUME ["/actions"]
2929
WORKDIR /actions
3030

31-
COPY --from=build /tmp/fakeroot/ /
31+
RUN mkdir -p /etc/ssl/certs
32+
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
3233

33-
## The loader search ld-linux-x86-64.so.2 in /lib64 but the folder does not exist
34-
RUN ln -s lib lib64
34+
COPY --from=build /tmp/fakeroot/ /
35+
COPY --from=ghcr.io/tarampampam/curl:8.6.0 /bin/curl /usr/bin/curl
36+
COPY --from=ghcr.io/jqlang/jq /jq /usr/bin/jq
3537

3638
ENTRYPOINT ["clever"]

templates/dockerhub/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Clever Tools Docker Image
22

3-
This is a lightweight Docker image intended to be used mostly in CI environment.
3+
This is a lightweight Docker image intended to be used mostly in CI environment.
44

55
## How to use
66

templates/dockerhub/test/Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM debian AS build
2+
3+
RUN apt-get update && apt-get install -y \
4+
libtool \
5+
curl
6+
7+
RUN curl --output clever-tools_linux.tar.gz https://clever-tools.clever-cloud.com/releases/3.8.1/clever-tools-3.8.1_linux.tar.gz \
8+
&& mkdir clever-tools_linux \
9+
&& tar xvzf clever-tools_linux.tar.gz -C clever-tools_linux --strip-components=1 \
10+
&& cp clever-tools_linux/clever /usr/local/bin
11+
12+
# Only grep the clever-tools binary and his libraries for the release stage
13+
# We use ldd to find the shared object dependencies.
14+
RUN \
15+
mkdir -p /tmp/fakeroot/lib && \
16+
cp $(ldd /usr/local/bin/clever | grep -o '/.\+\.so[^ ]*' | sort | uniq) /tmp/fakeroot/lib && \
17+
for lib in /tmp/fakeroot/lib/*; do strip --strip-all $lib; done && \
18+
mkdir -p /tmp/fakeroot/bin/ && \
19+
cp /usr/local/bin/clever /tmp/fakeroot/bin/
20+
21+
FROM busybox:glibc AS release
22+
23+
LABEL version="3.8.1" \
24+
maintainer="<%= maintainer %>" \
25+
description="<%= description %>" \
26+
license="<%= license %>"
27+
28+
VOLUME ["/actions"]
29+
WORKDIR /actions
30+
31+
RUN mkdir -p /etc/ssl/certs
32+
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
33+
34+
COPY --from=build /tmp/fakeroot/ /
35+
COPY --from=ghcr.io/tarampampam/curl:8.6.0 /bin/curl /usr/bin/curl
36+
COPY --from=ghcr.io/jqlang/jq /jq /usr/bin/jq
37+
38+
ENTRYPOINT ["sh"]

0 commit comments

Comments
 (0)