diff --git a/.github/workflows/docker-ncp-build.yml b/.github/workflows/docker-ncp-build.yml index 9df78d0..6463954 100644 --- a/.github/workflows/docker-ncp-build.yml +++ b/.github/workflows/docker-ncp-build.yml @@ -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 @@ -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