Browse Source

需求:调整镜像运行的用户名

lijie 2 years ago
parent
commit
57935d5541

+ 0 - 3
docker/dockerfiles/dmp-admin/Dockerfile

@@ -27,10 +27,7 @@ COPY version.txt $WORKER_HOME/
 COPY config/* $WORKER_HOME/config/
 #设置工作目录
 WORKDIR $WORKER_HOME
-RUN groupadd docker
-RUN useradd -d $WORKER_HOME -g docker -m docker
 #查看上述复制的文件,是否复制成功
 RUN ls
-USER docker
 #启动执行
 ENTRYPOINT ["sh","./entrypoint.sh"]

+ 0 - 3
docker/dockerfiles/dmp-alarm/Dockerfile

@@ -27,10 +27,7 @@ COPY version.txt $WORKER_HOME/
 COPY config/* $WORKER_HOME/config/
 #设置工作目录
 WORKDIR $WORKER_HOME
-RUN groupadd docker
-RUN useradd -d $WORKER_HOME -g docker -m docker
 #查看上述复制的文件,是否复制成功
 RUN ls
-USER docker
 #启动执行
 ENTRYPOINT ["sh","./entrypoint.sh"]

+ 0 - 3
docker/dockerfiles/dmp-dic/Dockerfile

@@ -28,10 +28,7 @@ COPY config/* $WORKER_HOME/config/
 #设置工作目录
 
 WORKDIR $WORKER_HOME
-RUN groupadd docker
-RUN useradd -d $WORKER_HOME -g docker -m docker
 #查看上述复制的文件,是否复制成功
 RUN ls
-USER docker
 #启动执行
 ENTRYPOINT ["sh","./entrypoint.sh"]

+ 0 - 3
docker/dockerfiles/dmp-org/Dockerfile

@@ -27,10 +27,7 @@ COPY version.txt $WORKER_HOME/
 COPY config/* $WORKER_HOME/config/
 #设置工作目录
 WORKDIR $WORKER_HOME
-RUN groupadd docker
-RUN useradd -d $WORKER_HOME -g docker -m docker
 #查看上述复制的文件,是否复制成功
 RUN ls
-USER docker
 #启动执行
 ENTRYPOINT ["sh","./entrypoint.sh"]

+ 0 - 3
docker/dockerfiles/dmp-rwd-edit/Dockerfile

@@ -27,10 +27,7 @@ COPY version.txt $WORKER_HOME/
 COPY config/* $WORKER_HOME/config/
 #设置工作目录
 WORKDIR $WORKER_HOME
-RUN groupadd docker
-RUN useradd -d $WORKER_HOME -g docker -m docker
 #查看上述复制的文件,是否复制成功
 RUN ls
-USER docker
 #启动执行
 ENTRYPOINT ["sh","./entrypoint.sh"]

+ 6 - 11
docker/dockerfiles/dmp-rwd/Dockerfile

@@ -18,20 +18,15 @@ ARG WORKER_HOME
 #执行的命令
 RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezon
 RUN yum install -y unzip zip wget telnet tzdata
-RUN mkdir -p $WORKER_HOME/app/config
-RUN groupadd docker
-RUN useradd -d $WORKER_HOME -g docker -m -s /bin/bash docker
+RUN mkdir -p $WORKER_HOME/config
 #设置工作目录
-WORKDIR $WORKER_HOME/app
+WORKDIR $WORKER_HOME
 #复制文件到容器内
-COPY *.jar $WORKER_HOME/app/app.jar
-COPY entrypoint.sh $WORKER_HOME/app/
-COPY version.txt $WORKER_HOME/app/
-COPY config/* $WORKER_HOME/app/config/
-RUN chmod 755 entrypoint.sh
-RUN chown -R docker:docker *
+COPY *.jar $WORKER_HOME/app.jar
+COPY entrypoint.sh $WORKER_HOME/
+COPY version.txt $WORKER_HOME/
+COPY config/* $WORKER_HOME/config/
 #查看上述复制的文件,是否复制成功
 RUN ls
-USER docker
 #启动执行
 ENTRYPOINT ["sh","./entrypoint.sh"]