# 使用するubuntuのバージョンを指定 FROM ubuntu:18.04 # 使うコマンドをインストール RUN apt-get -y update RUN apt-get install -y init RUN apt-get install -y systemd RUN apt-get install -y vim RUN apt-get -y autoclean RUN apt-get -y update RUN apt-get install -y openjdk-8-jre-headless #tomcatインストール RUN apt-get install -y tomcat9 tomcat9-admin RUN systemctl enable tomcat9 RUN echo '<?xml version="1.0" encoding="UTF-8"?> \n\ <!-- \n\ Licensed to the Apache Software Foundation (ASF) under one or more \n\ contributor license agreements. See the NOTICE file distributed with \n\ this work for additional information regarding copyright ownership. \n\ The ASF licenses this file to You under the Apache License, Version 2.0 \n\ (the "License"); you may not use this file except in compliance with \n\ the License. You may obtain a copy of the License at \n\ \n\ http://www.apache.org/licenses/LICENSE-2.0 \n\ \n\ Unless required by applicable law or agreed to in writing, software \n\ distributed under the License is distributed on an "AS IS" BASIS, \n\ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n\ See the License for the specific language governing permissions and \n\ limitations under the License. \n\ --> \n\ <tomcat-users xmlns="http://tomcat.apache.org/xml" \n\ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \n\ xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" \n\ version="1.0"> \n\ <!-- \n\ NOTE: By default, no user is included in the "manager-gui" role required \n\ to operate the "/manager/html" web application. If you wish to use this app, \n\ you must define such a user - the username and password are arbitrary. It is \n\ strongly recommended that you do NOT use one of the users in the commented out \n\ section below since they are intended for use with the examples web \n\ application. \n\ --> \n\ <!-- \n\ NOTE: The sample user and role entries below are intended for use with the \n\ examples web application. They are wrapped in a comment and thus are ignored \n\ when reading this file. If you wish to configure these users for use with the \n\ examples web application, do not forget to remove the <!.. ..> that surrounds \n\ them. You will also need to set the passwords to something appropriate. \n\ --> \n\ <!-- \n\ <role rolename="tomcat"/> \n\ <role rolename="role1"/> \n\ <user username="tomcat" password="<must-be-changed>" roles="tomcat"/> \n\ <user username="both" password="<must-be-changed>" roles="tomcat,role1"/> \n\ <user username="role1" password="<must-be-changed>" roles="role1"/> \n\ --> \n\ <role rolename="admin-gui" /> \n\ <role rolename="manager-gui" /> \n\ <user username="tomcat" password="pass" roles="admin-gui,manager-gui" /> \n\ </tomcat-users> ' > /etc/tomcat9/tomcat-users.xml RUN rm -rf /var/lib/tomcat9/webapps/ROOT ADD https://github.com/gitbucket/gitbucket/releases/download/4.5/gitbucket.war /var/lib/tomcat9/webapps/ RUN chmod -R 775 /var/lib/tomcat9/webapps RUN mkdir /home/tomcat9 RUN chown tomcat:tomcat /home/tomcat9 RUN usermod -d /home/tomcat9 tomcat CMD [ "/sbin/init" ]