提交dockerfile
This commit is contained in:
19
dockerfile/Dockerfile
Normal file
19
dockerfile/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# 以普通用户运行,未测试
|
||||||
|
# 基础镜像(以ubuntu为例,其他镜像如alpine、centos逻辑一致)
|
||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
# 1. 创建普通用户(指定UID/GID避免权限冲突,可选但推荐)
|
||||||
|
# -m:创建家目录;-s:指定shell;--uid/--gid:指定固定ID
|
||||||
|
RUN groupadd --gid 1001 appgroup && \
|
||||||
|
useradd --uid 1001 --gid appgroup --create-home --shell /bin/bash appuser
|
||||||
|
|
||||||
|
# 2. (可选)设置工作目录并修改权限(确保普通用户可读写)
|
||||||
|
WORKDIR /app
|
||||||
|
RUN chown -R appuser:appgroup /app
|
||||||
|
|
||||||
|
# 3. 切换到普通用户(关键:后续所有命令都以该用户执行)
|
||||||
|
USER appuser
|
||||||
|
|
||||||
|
# 4. 以普通用户运行CMD/ENTRYPOINT
|
||||||
|
# 示例:执行一个简单的脚本或应用
|
||||||
|
CMD ["echo", "当前用户:$(whoami),工作目录:$(pwd)"]
|
||||||
30
dockerfile/ImageMagick/Dockerfile-jdk
Normal file
30
dockerfile/ImageMagick/Dockerfile-jdk
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||||
|
|
||||||
|
#javajdk path
|
||||||
|
ADD jdk-17_linux-x64_bin.tar.gz /usr/local/
|
||||||
|
ENV JAVA_HOME /usr/local/jdk-17.0.7
|
||||||
|
ENV PATH $PATH:/usr/local/jdk-17.0.7/bin
|
||||||
|
|
||||||
|
COPY dumb-init /usr/bin/
|
||||||
|
|
||||||
|
COPY ImageMagick-7.1.1-29/ /usr/local/ImageMagick/
|
||||||
|
|
||||||
|
RUN yum -y install curl openssh unzip ca-certificates tzdata wget bash glibc-langpack-zh \
|
||||||
|
&& yum -y install fontconfig && fc-cache --force \
|
||||||
|
&& yum update -y libnghttp2 \
|
||||||
|
&& chmod +x /usr/bin/dumb-init \
|
||||||
|
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
|
&& echo "Asia/Shanghai" > /etc/timezone \
|
||||||
|
&& echo "export LC_ALL=zh_CN.utf8" >> /etc/profile \
|
||||||
|
&& echo "export LC_CTYPE=zh_CN.utf8" >> /etc/profile \
|
||||||
|
&& yum -y install libjpeg* libpng* freetype* zlib gcc make gcc-c++ \
|
||||||
|
&& cd /usr/local/ImageMagick && ./configure && make && make install \
|
||||||
|
&& yum clean all \
|
||||||
|
&& rm -rf /tmp/* /var/cache/yum/* \
|
||||||
|
&& source /etc/profile
|
||||||
|
|
||||||
|
#setup language 解决中文乱码
|
||||||
|
ENV LANG zh_CN.utf8
|
||||||
|
ENV LC_ALL zh_CN.utf8
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
18
dockerfile/ImageMagick/Dockerfile-tomact
Normal file
18
dockerfile/ImageMagick/Dockerfile-tomact
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||||
|
COPY jdk1.8 /usr/local/java/jdk1.8
|
||||||
|
ADD apache-tomcat-8.5.100.tar.gz /usr/local/
|
||||||
|
COPY ImageMagick-7.1.1-29/ /usr/local/ImageMagick/
|
||||||
|
|
||||||
|
RUN yum -y install libjpeg* libpng* freetype* zlib
|
||||||
|
# cd /usr/local/ImageMagick && ./configure && make && make install
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ENV JAVA_HOME /usr/local/java/jdk1.8
|
||||||
|
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
|
||||||
|
ENV CATALINA_HOME /usr/local/apache-tomcat-8.5.100
|
||||||
|
ENV CATALINE_BASH /usr/local/apache-tomcat-8.5.100
|
||||||
|
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINE_HOME/bin
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD ["/usr/local/apache-tomcat-8.5.100/bin/catalina.sh","run"]
|
||||||
28
dockerfile/jdk/17/Dockerfile
Normal file
28
dockerfile/jdk/17/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||||
|
|
||||||
|
#javajdk path
|
||||||
|
ADD jdk-17_linux-x64_bin.tar.gz /usr/local/
|
||||||
|
ENV JAVA_HOME /usr/local/jdk-17.0.7
|
||||||
|
ENV PATH $PATH:/usr/local/jdk-17.0.7/bin
|
||||||
|
|
||||||
|
COPY dumb-init /usr/bin/
|
||||||
|
|
||||||
|
RUN yum -y install curl openssh unzip ca-certificates tzdata wget bash glibc-langpack-zh \
|
||||||
|
&& yum -y install fontconfig && fc-cache --force \
|
||||||
|
&& yum update -y libnghttp2 \
|
||||||
|
&& chmod +x /usr/bin/dumb-init \
|
||||||
|
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
|
&& echo "Asia/Shanghai" > /etc/timezone \
|
||||||
|
&& curl -o /opt/arthas-boot.jar https://arthas.aliyun.com/arthas-boot.jar \
|
||||||
|
&& echo "export LC_ALL=zh_CN.utf8" >> /etc/profile \
|
||||||
|
&& echo "export LC_CTYPE=zh_CN.utf8" >> /etc/profile \
|
||||||
|
&& mkdir -pv /storage/operation-platform/logs \
|
||||||
|
&& yum clean all \
|
||||||
|
&& rm -rf /tmp/* /var/cache/yum/* \
|
||||||
|
&& source /etc/profile
|
||||||
|
|
||||||
|
#setup language 解决中文乱码
|
||||||
|
ENV LANG zh_CN.utf8
|
||||||
|
ENV LC_ALL zh_CN.utf8
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
10
dockerfile/jdk/8.371/CA/Dockerfile
Normal file
10
dockerfile/jdk/8.371/CA/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM harbor.wisetm.cn/base/anolisos-oraclejdk:371-1.0.1_fixed
|
||||||
|
COPY key/CFCA_OV_OCA.cer /var/lib/ca/CFCA_OV_OCA.cer
|
||||||
|
COPY key/CFCA_EV_ROOT.crt /var/lib/ca/CFCA_EV_ROOT.crt
|
||||||
|
COPY key/DigiCert-Global-Root-G2-Cross-G1.crt /var/lib/ca/DigiCert-Global-Root-G2-Cross-G1.crt
|
||||||
|
COPY key/globalsign-R1-R3.cer /var/lib/ca/globalsign-R1-R3.cer
|
||||||
|
|
||||||
|
RUN keytool -import -alias cfca_ov_oca -keystore /usr/local/java/jdk1.8.0_371/jre/lib/security/cacerts -storepass changeit -noprompt -file /var/lib/ca/CFCA_OV_OCA.cer \
|
||||||
|
&& keytool -import -alias cfca_ev_root -keystore /usr/local/java/jdk1.8.0_371/jre/lib/security/cacerts -storepass changeit -noprompt -file /var/lib/ca/CFCA_EV_ROOT.crt \
|
||||||
|
&& keytool -import -alias digicert-global-root-g2-cross-g1 -keystore /usr/local/java/jdk1.8.0_371/jre/lib/security/cacerts -storepass changeit -noprompt -file /var/lib/ca/DigiCert-Global-Root-G2-Cross-G1.crt \
|
||||||
|
&& keytool -import -alias globalsign-r1-r3 -keystore /usr/local/java/jdk1.8.0_371/jre/lib/security/cacerts -storepass changeit -noprompt -file /var/lib/ca/globalsign-R1-R3.cer
|
||||||
23
dockerfile/nginx/Dockerfile
Normal file
23
dockerfile/nginx/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||||
|
|
||||||
|
ADD nginx-1.24.0.tar.gz /usr/local/
|
||||||
|
|
||||||
|
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||||
|
source /etc/profile && \
|
||||||
|
echo "Asia/Shanghai" > /etc/timezone && \
|
||||||
|
yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel make && \
|
||||||
|
yum -y update libnghttp2 && \
|
||||||
|
useradd -M nginx && \
|
||||||
|
cd /usr/local/nginx-1.24.0/ && \
|
||||||
|
./configure --with-http_ssl_module --with-http_secure_link_module && make && make install && \
|
||||||
|
yum -y remove gcc-c++ && \
|
||||||
|
rm -rf /var/cache/yum/* && \
|
||||||
|
mkdir -pv /usr/local/nginx/conf/conf.d && \
|
||||||
|
mkdir -pv /storage/nginx_logs/ && chown -R nginx:nginx /storage/nginx_logs && \
|
||||||
|
echo "ok" > /usr/local/nginx/html/index.html && \
|
||||||
|
rm -rf /usr/local/nginx-1.24.0
|
||||||
|
|
||||||
|
COPY nginx.conf /usr/local/nginx/conf/
|
||||||
|
COPY localhost.conf /usr/local/nginx/conf/conf.d/
|
||||||
|
EXPOSE 80 443
|
||||||
|
CMD ["/usr/local/nginx/sbin/nginx","-g","daemon off;"]
|
||||||
23
dockerfile/nginx/Dockerfile-1.28.2
Normal file
23
dockerfile/nginx/Dockerfile-1.28.2
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
ARG NGINX_VERSION=1.28.2
|
||||||
|
|
||||||
|
#FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||||
|
FROM registry.openanolis.cn/openanolis/anolisos:8.10
|
||||||
|
|
||||||
|
ARG NGINX_VERSION
|
||||||
|
|
||||||
|
ADD nginx-${NGINX_VERSION}.tar.gz /usr/local/
|
||||||
|
|
||||||
|
RUN yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel make libnghttp2 && \
|
||||||
|
useradd -M nginx && \
|
||||||
|
cd /usr/local/nginx-${NGINX_VERSION}/ && \
|
||||||
|
./configure --with-http_ssl_module --with-http_secure_link_module && make && make install && \
|
||||||
|
mkdir -pv /usr/local/nginx/conf/conf.d && \
|
||||||
|
mkdir -pv /storage/nginx_logs/ && chown -R nginx:nginx /storage/nginx_logs && \
|
||||||
|
echo "ok" > /usr/local/nginx/html/index.html && \
|
||||||
|
rm -rf /usr/local/nginx-${NGINX_VERSION}
|
||||||
|
|
||||||
|
COPY nginx.conf /usr/local/nginx/conf/
|
||||||
|
COPY localhost.conf /usr/local/nginx/conf/conf.d/
|
||||||
|
COPY 404.html 50x.html /usr/local/nginx/html
|
||||||
|
EXPOSE 80 443
|
||||||
|
CMD ["/usr/local/nginx/sbin/nginx","-g","daemon off;"]
|
||||||
2
dockerfile/nginx/说明
Normal file
2
dockerfile/nginx/说明
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
配置 access /dev/strdout main; 可以把日志输出到控制台
|
||||||
|
还没有测试
|
||||||
6
dockerfile/node/node-22/Dockerfile
Normal file
6
dockerfile/node/node-22/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM registry.openanolis.cn/openanolis/anolisos:8.10
|
||||||
|
|
||||||
|
ENV NODE_VERSION="v22.21.1"
|
||||||
|
|
||||||
|
ADD node-${NODE_VERSION}-linux-x64.tar.xz /usr/local/
|
||||||
|
ENV PATH="/usr/local/node-${NODE_VERSION}-linux-x64/bin:${PATH}"
|
||||||
16
dockerfile/redis/Dockerfile
Normal file
16
dockerfile/redis/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||||
|
|
||||||
|
ADD redis-6.2.14.tar.gz /usr/local/
|
||||||
|
|
||||||
|
RUN yum -y update && \
|
||||||
|
yum -y install gcc make && \
|
||||||
|
yum clean all && \
|
||||||
|
cd /usr/local/ && \
|
||||||
|
ln -sf redis-6.2.14 redis && \
|
||||||
|
cd redis && \
|
||||||
|
make && \
|
||||||
|
make install
|
||||||
|
|
||||||
|
expose 6379 26379
|
||||||
|
workdir /usr/local/redis
|
||||||
|
#CMD ["/usr/local/bin/redis-server", "/usr/local/redis/redis.conf"]
|
||||||
19
dockerfile/tomcat/Dockerfile
Normal file
19
dockerfile/tomcat/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||||
|
COPY jdk1.8 /usr/local/java/jdk1.8
|
||||||
|
ADD apache-tomcat-8.5.100.tar.gz /usr/local/
|
||||||
|
COPY ImageMagick-7.1.1-29/ /usr/local/ImageMagick/
|
||||||
|
|
||||||
|
RUN yum -y install libjpeg* libpng* freetype* zlib gcc make gcc-c++ && \
|
||||||
|
cd /usr/local/ImageMagick && ./configure && make && make install && \
|
||||||
|
yum clean all
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ENV JAVA_HOME /usr/local/java/jdk1.8
|
||||||
|
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
|
||||||
|
ENV CATALINA_HOME /usr/local/apache-tomcat-8.5.100
|
||||||
|
ENV CATALINE_BASH /usr/local/apache-tomcat-8.5.100
|
||||||
|
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINE_HOME/bin
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD ["/usr/local/apache-tomcat-8.5.100/bin/catalina.sh","run"]
|
||||||
Reference in New Issue
Block a user