[docker 에러] When using COPY with more than one source file, the destination must be a directory and end with a /

2022. 7. 18. 15:38☁️ Cloud

에러 메시지

When using COPY with more than one source file, the destination must be a directory and end with a /

 

해결

Springboot 를 Docker image 로 빌드할 때 발생한 에러다. 

-> build/libs 경로에 빌드된 파일이 생성된다.

Dockerfile 의 ARG 인자에 *.jar 이라고 명시했는데, 이 때문에  libs 폴더의 2개의 jar 파일 중 어떤 것을 COPY 해야하는지 명확하지 않아 COPY 가 중단 된 것이다. 

그렇기 때문에 두 파일 중 하나를 삭제하면 된다. 아래의 snapshot-plain 파일을 없애주고 재 빌드 하였다.