본문 바로가기

Cloud/NCloud

4. CentOS7 : ncloud 서버 생성 및 Docker 초기 스크립트 설정

 

 

 

 

NAVER CLOUD PLATFORM

cloud computing services for corporations, IaaS, PaaS, SaaS, with Global region and Security Technology Certification

www.ncloud.com

 

※ 로그인 후 ncloud 사이트 우측 상단에 콘솔 클릭

 

Services → Server 선택

 

Server Init Script에서 script 파일 설정

 

 

 

 

#! /bin/bash

yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io

systemctl start docker
systemctl enable docker

docker pull httpd

cat > index.html << EOF
<html>
<body>
<h1>Container-WEBSERVER-1</h1>
</body>
</html>
EOF

docker run -itd --name h1 -p 80:80 httpd
docker cp index.html h1:/usr/local/apache2/htdocs/index.html

 

 

 

 

 

 

+