docker-vue3/npm
2023-10-25 12:14:48 +00:00

15 lines
470 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 读取docker.conf文件
source docker.conf
# 设置系统环境变量
export NODE_CONTAINER_NAME=$container_name
export NODE_IMAGE_VERSION=$image_version
# 判断NODE_CONTAINER_NAME的docker容器是否存在如果存在删除它
if docker ps -a --format '{{.Names}}' | grep -q "^$NODE_CONTAINER_NAME$"; then
docker rm -f $NODE_CONTAINER_NAME
fi
docker compose run --rm $NODE_CONTAINER_NAME npm --registry https://registry.npm.taobao.org "$@"