BG5 commited on
Commit
30ad7ec
·
verified ·
1 Parent(s): e9ab03d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -0
Dockerfile CHANGED
@@ -44,8 +44,22 @@ RUN mkdir -p /var/log/webmin && \
44
  chown root:root /var/log/webmin && \
45
  chmod 755 /var/log/webmin
46
 
 
 
 
 
 
 
 
 
47
  # 创建一个启动脚本
48
  RUN echo '#!/bin/bash' > /start-webmin.sh && \
 
 
 
 
 
 
49
  echo 'service webmin start' >> /start-webmin.sh && \
50
  echo 'tail -f /var/log/webmin/miniserv.log' >> /start-webmin.sh && \
51
  chmod +x /start-webmin.sh
 
44
  chown root:root /var/log/webmin && \
45
  chmod 755 /var/log/webmin
46
 
47
+ # 确保配置文件存在且权限正确
48
+ RUN touch /etc/webmin/miniserv.conf && \
49
+ chown root:root /etc/webmin/miniserv.conf && \
50
+ chmod 644 /etc/webmin/miniserv.conf
51
+
52
+ # 创建一个普通用户
53
+ RUN useradd -m webminuser
54
+
55
  # 创建一个启动脚本
56
  RUN echo '#!/bin/bash' > /start-webmin.sh && \
57
+ echo 'mkdir -p /var/log/webmin' >> /start-webmin.sh && \
58
+ echo 'chown root:root /var/log/webmin' >> /start-webmin.sh && \
59
+ echo 'chmod 755 /var/log/webmin' >> /start-webmin.sh && \
60
+ echo 'touch /etc/webmin/miniserv.conf' >> /start-webmin.sh && \
61
+ echo 'chown root:root /etc/webmin/miniserv.conf' >> /start-webmin.sh && \
62
+ echo 'chmod 644 /etc/webmin/miniserv.conf' >> /start-webmin.sh && \
63
  echo 'service webmin start' >> /start-webmin.sh && \
64
  echo 'tail -f /var/log/webmin/miniserv.log' >> /start-webmin.sh && \
65
  chmod +x /start-webmin.sh