Skip to content

Commit

Permalink
fix: 修复构建镜像和container清理顺序导致的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
WGrape committed Nov 28, 2022
1 parent a0a6048 commit 6fa7248
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# Build image
docker build -t ngxway .
if [ $? -ne 0 ]; then
echo -e ">>>>>>>>Start failure: failed to build<<<<<<<<"
exit 1
fi

# Handle container
containerCount=0
for file in $(docker container ls -f name=ngxwayContainer -q)
Expand All @@ -16,6 +9,17 @@ if [ $containerCount -ne 0 ]; then
exit 1
fi

# Pull without password
git config --global credential.helper store
git pull

# Build image
docker build -t ngxway .
if [ $? -ne 0 ]; then
echo -e ">>>>>>>>Start failure: failed to build<<<<<<<<"
exit 1
fi

# Run container
docker run --name ngxwayContainer -d -p 127.0.0.1:8090:8090 -v /tmp/logs:/dist/logs/ ngxway
if [ $? -ne 0 ]; then
Expand Down

0 comments on commit 6fa7248

Please sign in to comment.