Skip to content

Commit

Permalink
feat: add useful utilities to the chain docker images (#307)
Browse files Browse the repository at this point in the history
* feat: add useful write utils

* fix: install the utilities the right place after test
  • Loading branch information
Zak4sad authored Jan 9, 2025
1 parent 6f9691a commit 349c57c
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions dockerfile/avalanche/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN set -eux;\
LIBDIR=/usr/aarch64-linux-musl/lib;\
mkdir -p $LIBDIR;\
export CC=aarch64-linux-musl-gcc CXX=aarch64-linux-musl-g++;\
fi;\
fi;\
elif [ "${TARGETARCH}" = "amd64" ]; then\
export ARCH=x86_64;\
if [ "${BUILDARCH}" != "amd64" ]; then\
Expand Down Expand Up @@ -117,8 +117,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links) and rm (for cleanup) from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir amd vi from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm /bin/mv /bin/mkdir /bin/vi ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -155,7 +155,7 @@ RUN for b in \
; do ln sh $b; done

# Remove write utils
RUN rm ln rm
RUN rm ln

# Install chain binaries
COPY --from=build-env /root/bin /bin
Expand Down
6 changes: 3 additions & 3 deletions dockerfile/avalanche/native.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links) and rm (for cleanup) from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir, amd vi from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm /bin/mv /bin/mkdir /bin/vi ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -132,7 +132,7 @@ RUN for b in \
; do ln sh $b; done

# Remove write utils
RUN rm ln rm
RUN rm ln

# Install chain binaries
COPY --from=build-env /root/bin /bin
Expand Down
6 changes: 3 additions & 3 deletions dockerfile/cargo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links), rm (for cleanup), mv, mkdir, and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm /bin/mv /bin/mkdir /bin/dirname ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir, vi and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm /bin/mv /bin/mkdir /bin/vi /bin/dirname ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -301,7 +301,7 @@ ARG FINAL_IMAGE
RUN if [ ! -z "$FINAL_IMAGE" ]; then sh -c "$FINAL_IMAGE"; fi

# Remove write utils used to construct image and tmp dir/file for lib copy.
RUN rm -rf ln rm mv mkdir dirname /root/lib_abs /root/lib_abs.list
RUN rm -rf ln dirname /root/lib_abs /root/lib_abs.list

# Install trusted CA certificates
COPY --from=alpine-3 /etc/ssl/cert.pem /etc/ssl/cert.pem
Expand Down
6 changes: 3 additions & 3 deletions dockerfile/cargo/native.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links), rm (for cleanup), mv, mkdir, and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm /bin/mv /bin/mkdir /bin/dirname ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir, vi and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm /bin/mv /bin/mkdir /bin/vi /bin/dirname ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -251,7 +251,7 @@ ARG FINAL_IMAGE
RUN if [ ! -z "$FINAL_IMAGE" ]; then sh -c "$FINAL_IMAGE"; fi

# Remove write utils used to construct image and tmp dir/file for lib copy.
RUN rm -rf ln rm mv mkdir dirname /root/lib_abs /root/lib_abs.list
RUN rm -rf ln dirname /root/lib_abs /root/lib_abs.list

# Install trusted CA certificates
COPY --from=alpine-3 /etc/ssl/cert.pem /etc/ssl/cert.pem
Expand Down
6 changes: 3 additions & 3 deletions dockerfile/cosmos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links) and rm (for cleanup) from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/dirname ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir, vi and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/vi /bin/dirname ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -201,7 +201,7 @@ RUN sh -c 'i=0; while read DIR; do\
done < /root/dir_abs.list'

# Remove write utils
RUN rm ln rm mv mkdir dirname
RUN rm ln dirname

# Install chain binaries
COPY --from=build-env /root/bin /bin
Expand Down
6 changes: 3 additions & 3 deletions dockerfile/cosmos/local.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links) and rm (for cleanup) from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/dirname ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir, vi and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/vi /bin/dirname ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -192,7 +192,7 @@ RUN sh -c 'i=0; while read DIR; do\
done < /root/dir_abs.list'

# Remove write utils
RUN rm ln rm mv mkdir dirname
RUN rm ln dirname

# Install trusted CA certificates
COPY --from=alpine-3 /etc/ssl/cert.pem /etc/ssl/cert.pem
Expand Down
6 changes: 3 additions & 3 deletions dockerfile/cosmos/localcross.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links) and rm (for cleanup) from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/dirname ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir, vi and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/vi /bin/dirname ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -196,7 +196,7 @@ RUN sh -c 'i=0; while read DIR; do\
done < /root/dir_abs.list'

# Remove write utils
RUN rm ln rm mv mkdir dirname
RUN rm ln dirname

# Install chain binaries
COPY --from=build-env /root/bin /bin
Expand Down
6 changes: 3 additions & 3 deletions dockerfile/cosmos/native.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links) and rm (for cleanup) from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/dirname ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir, vi and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/vi /bin/dirname ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -174,7 +174,7 @@ RUN sh -c 'i=0; while read DIR; do\
done < /root/dir_abs.list'

# Remove write utils
RUN rm ln rm mv mkdir dirname
RUN rm dirname

# Install chain binaries
COPY --from=build-env /root/bin /bin
Expand Down
6 changes: 3 additions & 3 deletions dockerfile/imported/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/h

WORKDIR /bin

# Install ln (for making hard links), rm (for cleanup), mv, mkdir, and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/rm /bin/mv /bin/mkdir /bin/dirname ./
# Install ln (for making hard links), rm (for cleanup), mv, mkdir, vi and dirname from full busybox image (will be deleted, only needed for image assembly)
COPY --from=busybox-full /bin/ln /bin/mv /bin/rm /bin/mkdir /bin/vi /bin/dirname ./

# Install minimal busybox image as shell binary (will create hardlinks for the rest of the binaries to this data)
COPY --from=infra-toolkit /busybox/busybox /bin/sh
Expand Down Expand Up @@ -202,7 +202,7 @@ ARG FINAL_IMAGE
RUN if [ ! -z "$FINAL_IMAGE" ]; then sh -c "$FINAL_IMAGE"; fi

# Remove write utils used to construct image and tmp dir/file for lib copy.
RUN rm -rf ln rm mv mkdir dirname /root/lib_abs /root/lib_abs.list
RUN rm -rf ln dirname /root/lib_abs /root/lib_abs.list

# Install trusted CA certificates
COPY --from=alpine-3 /etc/ssl/cert.pem /etc/ssl/cert.pem
Expand Down

0 comments on commit 349c57c

Please sign in to comment.