[fix:6.0]更新Makefile中镜像名称定义及清理脚本;优化Dockerfile

This commit is contained in:
2020-09-13 18:30:40 +08:00
parent 3afd8e5762
commit 57777e7685
3 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -92,7 +92,7 @@ COPY customer /
# 以包管理方式安装软件包(Optional)
RUN select_source ${apt_source}
RUN install_pkg libssl1.1
#RUN install_pkg libssl1.1
RUN create_user && prepare_env
@@ -120,3 +120,4 @@ ENTRYPOINT ["entry.sh"]
# 应用程序的服务命令,必须使用非守护进程方式运行。如果使用变量,则该变量必须在运行环境中存在(ENV可以获取)
CMD ["${APP_EXEC}", "${REDIS_CONF_FILE}"]
+4 -4
View File
@@ -2,7 +2,7 @@
#
# 当前 Docker 镜像的编译脚本
app_name := colovu/redis
app_name :=colovu/redis
# 生成镜像TAG,类似:
# <镜像名>:<分支名>-<Git ID> # Git 仓库且无文件修改直接编译
@@ -38,13 +38,13 @@ build: build-debian build-alpine
# 清理悬空的镜像(无TAG)及停止的容器
clean:
@echo "Clean untaged images and stoped containers..."
@docker ps -a | grep "Exited" | awk '{print $$1}' | xargs docker rm
@docker images | grep '<none>' | awk '{print $$3}' | xargs docker rmi -f
@docker ps -a | grep "Exited" | awk '{print $$1}' | xargs docker rm | :
@docker images | grep '<none>' | awk '{print $$3}' | xargs docker rmi -f | :
# 为了防止删除前缀名相同的镜像,在过滤条件中加入一个空格进行过滤
clearclean: clean
@echo "Clean all images for current application..."
@docker images | grep "$(app_name) " | awk '{print $$3}' | xargs docker rmi -f
@docker images | grep "$(app_name) " | awk '{print $$3}' | xargs docker rmi -f | :
tag:
@echo "Add tag: $(local_registory)/$(app_name):latest"
+2 -2
View File
@@ -92,8 +92,8 @@ LABEL \
COPY customer /
# 以包管理方式安装软件包(Optional)
#RUN select_source ${apt_source}
RUN install_pkg openssl
RUN select_source ${apt_source}
#RUN install_pkg libssl1.1
RUN create_user && prepare_env