Centos7 setup with DockerFile

hansung.dev·2023년 6월 16일
post-thumbnail

DockerFile를 사용하여 Centos7 서버를 구성합니다.

Getting Started

실습 환경 정보는 아래와 같습니다.

OS : macOS Ventura Ver 13.4
Docker : 23.0.5
DockerFile : Centos7.2009

dockerfilr

dockerfile 파일을 살펴보도록 하겠습니다.

FROM docker.io/centos:7.9.2009

# 사용자 지정
USER root

# 언어셋 설치
RUN yum clean all \
 && yum repolist \
 && yum -y update \
 && sed -i "s/en_US/all/" /etc/yum.conf  \
 && yum -y reinstall glibc-common

# 기본적으로 필요한 OS 패키지를 설치한다.
RUN  yum -y install tar unzip vi vim telnet net-tools curl openssl \
 && yum -y install apr apr-util apr-devel apr-util-devel \
 && yum -y install elinks locate python-setuptools \
 && yum clean all

ENV LANG=ko_KR.utf8 TZ=Asia/Seoul

# 컨테이너 실행시 실행될 명령
CMD ["/bin/bash"]

DockerFile Build

docker build -t centos79-base .
(base) ➜  centos-7.9 docker images
REPOSITORY      TAG       IMAGE ID       CREATED          SIZE
centos79-base   latest    62e2f45d27f1   17 seconds ago   1.22GB

Setting up and running

docker run -ti centos79-base

출처: http://wiki.rockplace.co.kr/pages/viewpage.action?pageId=3216627

profile
Data Engineer

0개의 댓글