Skip to content

Commit

Permalink
Update scratch image to plain apline:3 like a final image
Browse files Browse the repository at this point in the history
  • Loading branch information
felichita committed Jun 30, 2024
1 parent 589e1c2 commit 5effed3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 167 deletions.
6 changes: 3 additions & 3 deletions chains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -522,16 +522,16 @@
- /go/bin/dymd

# Dymension Rollapp evm
- name: dymension-rollap-evm
- name: dymension-rollapp-evm
github-organization: dymensionxyz
github-repo: rollapp-evm
dockerfile: cosmos
build-target: make install
build-target: make build
build-env:
- BECH32_PREFIX=cry
- BUILD_TAGS=netgo,muslc
binaries:
- /go/bin/rollap-evm
- build/rollapp-evm

# dydx
- name: dydx
Expand Down
41 changes: 2 additions & 39 deletions dockerfile/cosmos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,52 +129,15 @@ FROM busybox:1.34.1-musl AS busybox-full
FROM alpine:3 as alpine-3

# Build final image from scratch
FROM scratch
FROM apline:3

LABEL org.opencontainers.image.source="https://github.com/p2p-org/cosmos-heighliner"

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

# Install jq
COPY --from=infra-toolkit /usr/local/bin/jq /bin/

# Add hard links for read-only utils
# Will then only have one copy of the busybox minimal binary file with all utils pointing to the same underlying inode
RUN for b in \
cat \
date \
df \
du \
env \
grep \
head \
less \
ls \
md5sum \
pwd \
sha1sum \
sha256sum \
sha3sum \
sha512sum \
sleep \
stty \
tail \
tar \
tee \
tr \
watch \
which \
; do ln sh $b; done

# Remove write utils
RUN rm ln rm

# Install chain binaries
COPY --from=build-env /root/bin /bin

Expand All @@ -184,7 +147,7 @@ COPY --from=build-env /root/lib /lib
# Install trusted CA certificates
COPY --from=alpine-3 /etc/ssl/cert.pem /etc/ssl/cert.pem

# Install heighliner user
# Install p2p user
COPY --from=infra-toolkit /etc/passwd /etc/passwd
COPY --from=infra-toolkit --chown=1111:1111 /home/p2p /home/p2p
COPY --from=infra-toolkit --chown=1111:1111 /tmp /tmp
Expand Down
42 changes: 1 addition & 41 deletions dockerfile/cosmos/local.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,55 +43,15 @@ FROM busybox:1.34.1-musl AS busybox-full
FROM alpine:3 as alpine-3

# Build part 1 of the final image
FROM scratch AS final-part1
FROM alpine:3 AS final-part1

LABEL org.opencontainers.image.source="https://github.com/p2p-org/cosmos-heighliner"

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

# Install jq
COPY --from=infra-toolkit /usr/local/bin/jq /bin/

# Add hard links for read-only utils
# Will then only have one copy of the busybox minimal binary file with all utils pointing to the same underlying inode
RUN for b in \
cat \
date \
df \
du \
env \
grep \
head \
less \
ls \
md5sum \
pwd \
sha1sum \
sha256sum \
sha3sum \
sha512sum \
sleep \
stty \
tail \
tar \
tee \
tr \
watch \
which \
; do ln sh $b; done

# Remove write utils
RUN rm ln rm

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

# Install p2p user
COPY --from=infra-toolkit /etc/passwd /etc/passwd
COPY --from=infra-toolkit --chown=1111:1111 /home/p2p /home/p2p
Expand Down
44 changes: 2 additions & 42 deletions dockerfile/cosmos/localcross.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,62 +116,22 @@ FROM busybox:1.34.1-musl AS busybox-full
FROM alpine:3 as alpine-3

# Build final image from scratch
FROM scratch
FROM alpine:3

LABEL org.opencontainers.image.source="https://github.com/p2p-org/heighliner"

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

# Install jq
COPY --from=infra-toolkit /usr/local/bin/jq /bin/

# Add hard links for read-only utils
# Will then only have one copy of the busybox minimal binary file with all utils pointing to the same underlying inode
RUN for b in \
cat \
date \
df \
du \
env \
grep \
head \
less \
ls \
md5sum \
pwd \
sha1sum \
sha256sum \
sha3sum \
sha512sum \
sleep \
stty \
tail \
tar \
tee \
tr \
watch \
which \
; do ln sh $b; done

# Remove write utils
RUN rm ln rm

# Install chain binaries
COPY --from=build-env /root/bin /bin

# Install libraries
COPY --from=build-env /root/lib /lib

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

# Install heighliner user
# Install p2p user
COPY --from=infra-toolkit /etc/passwd /etc/passwd
COPY --from=infra-toolkit --chown=1111:1111 /home/p2p /home/p2p
COPY --from=infra-toolkit --chown=1111:1111 /tmp /tmp
Expand Down
44 changes: 2 additions & 42 deletions dockerfile/cosmos/native.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,62 +103,22 @@ FROM busybox:1.34.1-musl AS busybox-full
FROM alpine:3 as alpine-3

# Build final image from scratch
FROM scratch
FROM alpine:3

LABEL org.opencontainers.image.source="https://github.com/p2p-org/cosmos-heighliner"

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

# Install jq
COPY --from=infra-toolkit /usr/local/bin/jq /bin/

# Add hard links for read-only utils
# Will then only have one copy of the busybox minimal binary file with all utils pointing to the same underlying inode
RUN for b in \
cat \
date \
df \
du \
env \
grep \
head \
less \
ls \
md5sum \
pwd \
sha1sum \
sha256sum \
sha3sum \
sha512sum \
sleep \
stty \
tail \
tar \
tee \
tr \
watch \
which \
; do ln sh $b; done

# Remove write utils
RUN rm ln rm

# Install chain binaries
COPY --from=build-env /root/bin /bin

# Install libraries
COPY --from=build-env /root/lib /lib

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

# Install heighliner user
# Install p2p user
COPY --from=infra-toolkit /etc/passwd /etc/passwd
COPY --from=infra-toolkit --chown=1111:1111 /home/p2p /home/p2p
COPY --from=infra-toolkit --chown=1111:1111 /tmp /tmp
Expand Down

0 comments on commit 5effed3

Please sign in to comment.