Skip to content

Chore: optimize Dockerfile #692

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

marcelosalloum
Copy link
Collaborator

What

Optimize Dockerfile, making images smaller by 33% 85.55MB -> 59.17MB

Why

📈 Kaizen

Checklist

  • Title follows SDP-1234: Add new feature or Chore: Refactor package xyz format. The Jira ticket code was included if available.
  • PR has a focused scope and doesn't mix features with refactoring
  • Tests are included (if applicable)
  • CHANGELOG.md is updated (if applicable)
  • CONFIG/SECRETS changes are updated in helmcharts and deployments (if applicable)
  • Preview deployment works as expected
  • Ready for production

@marcelosalloum marcelosalloum requested a review from Copilot May 23, 2025 22:08
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests May 23, 2025 22:08 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 23, 2025 22:08 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests May 23, 2025 22:08 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 23, 2025 22:08 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum marked this pull request as ready for review May 23, 2025 22:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes Dockerfiles by switching from Debian/Ubuntu-based images to Alpine-based images and replacing apt-get with apk add to reduce overall image sizes.

  • Updated base images for Node, Go, Nginx, and Alpine runtime to their Alpine variants.
  • Replaced apt-get commands with apk add --no-cache across all Dockerfiles.
  • Reduced final image size by ~33%.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
dev/Dockerfile-demo-wallet Switched node:18node:18-alpine, nginx:1.17nginx:1.17-alpine, replaced apt-get with apk.
Dockerfile.development Switched builder & development stages to golang:1.24.2-alpine, replaced apt-get with apk.
Dockerfile Switched builder to golang:1.24.2-alpine, runtime to alpine:3.19, replaced apt-get with apk.
Comments suppressed due to low confidence (2)

Dockerfile:9

  • [nitpick] Use COPY . ./ instead of ADD when no extraction or remote URL fetch is needed; it’s more explicit and avoids unintended behaviors.
ADD . ./

Dockerfile.development:5

  • The comment mentions Delve but the stage does not install it. If remote debugging with Delve is required, add apk add --no-cache delve; otherwise update the comment to reflect the actual tools being installed.
# Stage 2: Setup the development environment with Delve for debugging

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

Something went wrong with PR preview build please check

@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 24, 2025 00:26 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum had a problem deploying to Anchor Integration Tests May 24, 2025 00:26 — with GitHub Actions Failure
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 24, 2025 00:26 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests May 24, 2025 00:26 — with GitHub Actions Inactive
@stellar-jenkins
Copy link

Something went wrong with PR preview build please check

@stellar-jenkins
Copy link

@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 24, 2025 00:31 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests May 24, 2025 00:31 — with GitHub Actions Inactive
@stellar-jenkins
Copy link

@marcelosalloum marcelosalloum force-pushed the marcelo/optimize-dockerfile branch from 26508f8 to fd18d52 Compare May 27, 2025 17:18
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) May 27, 2025 17:18 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests May 27, 2025 17:18 — with GitHub Actions Inactive
@stellar-jenkins
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants