본문 바로가기
linux/docker

docker tomcat 이미지에 nginx를 추가하여 이미지 생성

by 후린트 2018. 3. 15.
반응형



빌드 및 실행 방법



git clone https://github.com/hulint/docker.git
docker build ./nginx_tomcat -f ./nginx_tomcat/Dockerfile -t nginx_tomcat:0.1
docker run -p 80:80 -d tomcat_nginx:0.1
curl -v http://localhost:80
>
* About to connect() to localhost port 80 (#0)
* Trying ::1...
* Connected to localhost (::1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost
> Accept: */*
>
< HTTP/1.1 200
< Server: nginx/1.12.2
< Date: Thu, 15 Mar 2018 07:24:05 GMT
< Content-Type: text/html;charset=UTF-8
< Content-Length: 109
< Connection: keep-alive
< Set-Cookie: JSESSIONID=35831731B502DD714218437AB0F5C49E; Path=/; HttpOnly
< X-UA-Compatible: IE=edge
<
<html>
<head>
<title>hello!!!!</title>
</head>
<body>
<h2>welcome hello world</h2>
</body>
</html>




반응형