Skip to content

Commit

Permalink
fix: 배포시 다른 컨테이너 종료시키는 명령어 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jaewoong2 committed Mar 30, 2024
1 parent 1f91071 commit 779683f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/docker-ncp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
docker login -u ${{ secrets.NCP_ACCESS_KEY }} -p ${{ secrets.NCP_SECRET_KEY }} ${{ secrets.NCP_CONTAINER_REGISTRY }}
docker pull ${{ secrets.NCP_CONTAINER_REGISTRY }}/tag-name
# 이미지 이름으로 실행 중인 컨테이너 ID를 찾기
CONTAINER_IDS=$(docker ps -q --filter ancestor=${{ secrets.NCP_CONTAINER_REGISTRY }}/tag-name)
CONTAINER_IDS=$(docker ps -q --filter label=app=spring)
# 찾은 컨테이너 종료
if [ ! -z "$CONTAINER_IDS" ]; then
Expand All @@ -91,9 +91,7 @@ jobs:
fi
# 이미지 실행
docker run -d -p 8080:8080 ${{ secrets.NCP_CONTAINER_REGISTRY }}/tag-name
docker run -d -p 8080:8080 --label app=spring ${{ secrets.NCP_CONTAINER_REGISTRY }}/tag-name
# 사용하지 않는 이미지 정리
docker image prune -f
docker run -d -p 8080:8080 ${{ secrets.NCP_CONTAINER_REGISTRY }}/tag-name
docker image prune -f

0 comments on commit 779683f

Please sign in to comment.