ASUS X450J @ Windows 10 x64
docker
1. 檔案架構
yourproject/
Dockerfile
webapp/
WEB-INF/
classes/
lib/
web.xml
index.jsp
yourproject/webapp/WEB-INF/web.xml
<web-app>
</web-app>
yourproject/webapp/index.jsp
<!doctype html>
<h1>It works!</h1>
<%
for (int i = 0; i < 5; ++i) {
out.println("<p>Hello, world!</p>");
}
%>
Dockerfile
FROM tomcat:9.0.1-jre8-alpine
ADD ./webapp /usr/local/tomcat/webapps/webapp
CMD ["catalina.sh", "run"]
$ docker build -t mywebapp .
$ docker run --rm -it -p 8888:8080 mywebapp
沒有留言:
張貼留言