Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): add curl and jq binaries #798

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions templates/dockerhub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/ && \
Expand All @@ -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
pdesoyres-cc marked this conversation as resolved.
Show resolved Hide resolved

ENTRYPOINT ["clever"]
2 changes: 1 addition & 1 deletion templates/dockerhub/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
42 changes: 42 additions & 0 deletions templates/dockerhub/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# THIS IS A TEST FILE ... TO BE DELETED
FROM debian AS build
pdesoyres-cc marked this conversation as resolved.
Show resolved Hide resolved

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"]