실습

Ncloud에서 웹 페이지 생성

뵤루 2022. 6. 2. 13:46

 

초기 스크립트만으로 서버 설정

 

[스크립트]
#! /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
cat > index.html << EOF
<html>
<body>
<h1>Ncloud-Webserver-1</h1>
</body>
</html>
EOF
docker pull httpd
docker run -itd -p 50000:80 --name h1 httpd
docker cp index.html h1:/usr/local/apache2/htdocs/index.html