글 작성자: 모두의 근삼이

dockerfile을 이용하여 패키지를 설치하는데, 아래와 같이 선택을 해야하는 항목들이 여러개 발생하여 작업에 어려움이 있었다.

Preconfiguring packages ...
Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

 1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
 2. America     5. Arctic     8. Europe    11. SystemV
 3. Antarctica  6. Asia       9. Indian    12. US
Geographic area: 

이런 경우에는 환경변수에 DEBIAN_FRONTEND=noninteractive 와 같이 추가를 해주면 패키지 설치시에도 상호작용 방지기능이 적용되어 Dockerfile로 패키지 설치 작업 진행시 수월하게 할 수 있다.

ex)

FROM ubuntu:latest

FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
    apt-get install -y  bash git openssh-server rsync augeas-tools libdbd-mysql-perl python3

...
생략
...
반응형