Skip to content

Docker 런타임 베이스 변경#197

Merged
zionhann merged 1 commit intoHandongSF:mainfrom
zionhann:cherry/d5af4f6
Mar 5, 2026
Merged

Docker 런타임 베이스 변경#197
zionhann merged 1 commit intoHandongSF:mainfrom
zionhann:cherry/d5af4f6

Conversation

@zionhann
Copy link
Member

@zionhann zionhann commented Mar 5, 2026

  • Docker 런타임 베이스 이미지를 JRE 중심으로 정리했습니다

    런타임 이미지의 목적은 애플리케이션 실행에 필요한 최소 구성만 제공하는 것입니다. JRE 기반으로 전환하면 이미지 크기와 공격 표면을 줄일 수 있어 운영 안정성에 유리합니다. 이번 변경은 기존 배포 흐름을 유지하면서 런타임 레이어를 더 단순하게 가져가려는 의도입니다. 결과적으로 빌드 산출물 실행 환경을 더 가볍고 명확하게 유지할 수 있습니다.

  • 런타임 사용자 설정을 단순화했습니다

    컨테이너 실행 사용자 구성은 보안과 운영 일관성에 직접 영향을 줍니다. 사용자/권한 설정이 과도하게 복잡하면 유지보수 시 오히려 실수 가능성이 커집니다. 이번 수정은 비루트 실행 원칙을 지키면서도 설정 부담을 줄여 재현성과 운영 편의성을 함께 확보하려는 목적입니다. 이를 통해 Dockerfile의 의도를 더 읽기 쉽게 유지할 수 있습니다.


Human Note

useradd 명령어가 포함된 베이스 이미지로 변경해서 비루트 실행을 위한 권한 설정 과정에서 불필요한 의존성을 설치하지 않도록 했습니다.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5ca95e74-6abd-4818-9353-7d911b0cf9ec

📥 Commits

Reviewing files that changed from the base of the PR and between 73224e8 and 7b9fbeb.

📒 Files selected for processing (1)
  • Dockerfile

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • 애플리케이션 배포 인프라를 업데이트했습니다. 컨테이너 빌드 및 런타임 실행 환경의 기반이 최신화되어 시스템 호환성이 향상되었으며 보안 수준도 강화되었습니다. 런타임 환경 설정을 최적화하여 더욱 안정적이고 신뢰할 수 있는 배포 환경을 제공합니다.

Walkthrough

Dockerfile의 빌더 단계 기본 이미지를 amazoncorretto:17에서 eclipse-temurin:17-jdk-jammy로, 런타임 단계를 amazoncorretto:17에서 eclipse-temurin:17-jre-jammy로 변경했습니다. 앱 사용자의 쉘을 /sbin/nologin에서 /bin/false로 변경했습니다.

Changes

Cohort / File(s) Summary
Base Image 및 User Shell 변경
Dockerfile
빌더 스테이지 기본 이미지를 amazoncorretto:17에서 eclipse-temurin:17-jdk-jammy로 변경, 런타임 스테이지 기본 이미지를 amazoncorretto:17에서 eclipse-temurin:17-jre-jammy로 변경, 앱 사용자의 쉘을 /sbin/nologin에서 /bin/false로 변경했습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 Dockerfile의 런타임 환경을 최적화하고 사용자 설정을 단순화하는 것을 목표로 합니다. 베이스 이미지를 JRE 기반으로 전환하여 이미지 크기와 공격 표면을 줄이고, 사용자 계정 설정을 명확히 하여 보안과 운영 일관성을 향상시킵니다. 이는 애플리케이션 실행 환경을 더 가볍고 안전하며 유지보수하기 쉽게 만듭니다.

Highlights

  • Docker 베이스 이미지 변경: 빌더 스테이지와 런타임 스테이지 모두 Amazon Corretto JDK 17에서 Eclipse Temurin JDK 17로 변경하여 JRE 중심의 경량화된 런타임 환경을 구축했습니다.
  • 사용자 설정 단순화 및 보안 강화: app 사용자의 로그인 셸을 /sbin/nologin에서 /bin/false로 변경하여 비루트 실행 원칙을 유지하면서 사용자 설정을 단순화하고 보안을 강화했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Dockerfile
    • 빌더 및 런타임 스테이지의 베이스 이미지를 Amazon Corretto에서 Eclipse Temurin으로 변경했습니다.
    • app 사용자의 로그인 셸을 /sbin/nologin에서 /bin/false로 수정했습니다.
Activity
  • zionhann 님이 이 풀 리퀘스트를 생성했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@zionhann zionhann changed the title Docker 런타임 베이스와 사용자 설정을 단순화합니다 Docker 런타임 베이스 변경 Mar 5, 2026
@zionhann zionhann merged commit 4be55be into HandongSF:main Mar 5, 2026
1 of 2 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 Pull Request는 Dockerfile의 런타임 환경을 최적화하고 사용자 설정을 단순화하는 중요한 개선 사항을 담고 있습니다. JRE 기반의 경량 이미지로 전환하여 이미지 크기와 공격 표면을 줄인 점과, 비루트(non-root) 사용자 설정을 명확히 한 점은 좋은 방향입니다.

리뷰 결과, 한 가지 개선점을 제안합니다. groupadduseradd 명령어에 GID와 UID를 명시적으로 할당하여 빌드 재현성과 권한 관리의 예측 가능성을 높이는 것이 좋겠습니다. 자세한 내용은 아래 주석을 참고해 주세요.

Comment on lines 19 to 22
RUN groupadd -r app && \
useradd -r -g app -d /webapp -s /sbin/nologin app && \
useradd -r -g app -d /webapp -s /bin/false app && \
mkdir -p image log && \
chown -R app:app /webapp

Choose a reason for hiding this comment

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

medium

현재 groupadduseradd 명령어는 -r 플래그를 사용하여 시스템이 동적으로 GID와 UID를 할당하도록 되어 있습니다. 이로 인해 빌드 환경에 따라 다른 ID가 할당될 수 있어, 일관성과 보안 측면에서 예측 불가능한 문제를 야기할 수 있습니다.

-g (GID)와 -u (UID) 옵션을 사용하여 그룹과 사용자의 ID를 명시적으로 지정하고 -r 플래그를 제거하는 것이 좋습니다. 이렇게 하면 컨테이너의 권한 관리가 더 예측 가능해지고, 특히 여러 환경에 배포하거나 볼륨 권한을 다룰 때 발생할 수 있는 문제를 예방할 수 있습니다. 일반적으로 1000번 이상의 비-시스템 ID를 사용하는 것이 권장됩니다.

RUN groupadd -g 1001 app && \
    useradd -u 1001 -g app -d /webapp -s /bin/false app && \
    mkdir -p image log && \
    chown -R app:app /webapp

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.

1 participant