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

DOPS-3495 create distroless images #46

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def pipeline = new org.rust.AppPipeline(steps: this,
initSubmodules: true,
envImageName: 'docker.soramitsu.co.jp/sora2/env:latest',
appImageName: 'docker.soramitsu.co.jp/sora2/bridge-relayer',
pushTags: ['master':'latest', 'ton-bridge': 'ton-bridge'],
pushTags: ['master':'latest', 'duty/bridge-relayer-distroless': 'distroless'],
buildTestCmds: 'housekeeping/build.sh',
codeCoverageCommand: './housekeeping/coverage.sh',
clippyLinter: false,
Expand Down
20 changes: 20 additions & 0 deletions housekeeping/docker/release/Dockerfile.distroless
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM debian:bookworm-slim AS builder

RUN apt-get update && apt-get install -y \

Check warning on line 3 in housekeeping/docker/release/Dockerfile.distroless

View check run for this annotation

Soramitsu-Sonar-PR-decoration / bridge-relayer Sonarqube Results

housekeeping/docker/release/Dockerfile.distroless#L3

Merge this RUN instruction with the consecutive ones.

Check warning on line 3 in housekeeping/docker/release/Dockerfile.distroless

View check run for this annotation

Soramitsu-Sonar-PR-decoration / bridge-relayer Sonarqube Results

housekeeping/docker/release/Dockerfile.distroless#L3

Make sure automatically installing recommended packages is safe here.
ca-certificates libssl3 && \
apt-get clean

RUN mkdir -p /libs

COPY ./target/release/bridge-relayer /usr/local/bin/relayer

RUN ldd /usr/local/bin/relayer | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /libs/

FROM gcr.io/distroless/cc-debian12:nonroot

COPY --from=builder /libs/* /usr/lib/
COPY --from=builder /usr/local/bin/relayer /usr/local/bin/relayer

USER 10000

CMD ["/usr/local/bin/relayer"]
Loading