Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (seongtaejeong at gmail.com)
홈페이지
첨부 파일
 

ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

희한하군요, 분명히 파일이 있는데도,

$ cat Dockerfile
FROM ubuntu:24.04

$ docker build -f Dockerfile -t ubuntu24_dotnet_img .
[+] Building 2.0s (1/1) FINISHED                                                                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                                                                                       0.4s
 => => transferring dockerfile: 2B                                                                                                                                         0.0s
ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

저렇게 Dockerfile을 열 수 없다고 오류가 발생합니다. 혹시나 권한이나 인자에 뭔가 오류가 있을까 싶어 조정해 봐도,

$ chmod 777 Dockerfile

// 또는 이렇게 실행해도,
$ docker build .

오류는 그대로였습니다. 이에 대해 검색해 보면,

Docker build can't find Dockerfile even when it's the only file in the folder
; https://stackoverflow.com/questions/78022884/docker-build-cant-find-dockerfile-even-when-its-the-only-file-in-the-folder

다행히 redirection을 이용한 우회 방법이 하나 나옵니다. ^^

$ docker build - < Dockerfile

진짜로 저렇게 하면 ^^; docker build가 잘됩니다.




위의 stackoverflow 답변에 보면 의미 있는 대답이 하나 있는데요,

I had to uninstall snap docker completely and install docker properly as described in the answer here

저도 해당 머신에 "snap install docker"로 설치한 유형이었습니다. 귀찮아서 저는 제거 및 다른 방법으로 설치하지는 않았지만, 예전에 닷넷도 snap으로 설치한 경우 이상하게 동작했던 경험에 비춰볼 때 아마도 snap과 관련되면서 뭔가 환경적인 요인에서 틀어지는 것이 아닌가 싶습니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 8/18/2025]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 46  47  48  49  50  51  52  [53]  54  55  56  57  58  59  60  ...
NoWriterDateCnt.TitleFile(s)
12693정성태6/30/202117596오류 유형: 731. Azure Web App Site Extension - Failed to install web app extension [...]. {1}
12692정성태6/30/202118872디버깅 기술: 180. Azure - Web App의 비정상 종료 시 남겨지는 로그 확인
12691정성태6/30/202118200개발 환경 구성: 573. 테스트 용도이지만 테스트에 적합하지 않은 Azure D1 공유(shared) 요금제
12690정성태6/28/202119183Java: 23. Azure - 자바(Java)로 만드는 Web App Service - Tomcat 호스팅
12689정성태6/25/202122207오류 유형: 730. Windows Forms 디자이너 - The class Form1 can be designed, but is not the first class in the file. [1]
12688정성태6/24/202121758.NET Framework: 1073. C# - JSON 역/직렬화 시 리플렉션 손실을 없애는 JsonSrcGen [2]파일 다운로드1
12687정성태6/22/202118207오류 유형: 729. Invalid data: Invalid artifact, java se app service only supports .jar artifact
12686정성태6/21/202118781Java: 22. Azure - 자바(Java)로 만드는 Web App Service - Java SE (Embedded Web Server) 호스팅
12685정성태6/21/202121780Java: 21. Azure Web App Service에 배포된 Java 프로세스의 메모리 및 힙(Heap) 덤프 뜨는 방법
12684정성태6/19/202120264오류 유형: 728. Visual Studio 2022부터 DTE.get_Properties 속성 접근 시 System.MissingMethodException 예외 발생
12683정성태6/18/202120176VS.NET IDE: 166. Visual Studio 2022 - Windows Forms 프로젝트의 x86 DLL 컨트롤이 Designer에서 오류가 발생하는 문제 [1]파일 다운로드1
12682정성태6/18/202116416VS.NET IDE: 165. Visual Studio 2022를 위한 Extension 마이그레이션
12681정성태6/18/202117890오류 유형: 727. .NET 2.0 ~ 3.5 + x64 환경에서 System.EnterpriseServices 참조 시 CS8012 경고
12680정성태6/18/202120033오류 유형: 726. python2.7.exe 실행 시 0xc000007b 오류
12679정성태6/18/202119164COM 개체 관련: 23. CoInitializeSecurity의 전역 설정을 재정의하는 CoSetProxyBlanket 함수 사용법파일 다운로드1
12678정성태6/17/202117073.NET Framework: 1072. C# - CoCreateInstance 관련 Inteop 오류 정리파일 다운로드1
12677정성태6/17/202122071VC++: 144. 역공학을 통한 lxssmanager.dll의 ILxssSession 사용법 분석파일 다운로드1
12676정성태6/16/202120087VC++: 143. ionescu007/lxss github repo에 공개된 lxssmanager.dll의 CLSID_LxssUserSession/IID_ILxssSession 사용법파일 다운로드1
12675정성태6/16/202118691Java: 20. maven package 명령어 결과물로 (war가 아닌) jar 생성 방법
12674정성태6/15/202119198VC++: 142. DEFINE_GUID 사용법
12673정성태6/15/202118962Java: 19. IntelliJ - 자바(Java)로 만드는 Web App을 Tomcat에서 실행하는 방법
12672정성태6/15/202121911오류 유형: 725. IntelliJ에서 Java webapp 실행 시 "Address localhost:1099 is already in use" 오류
12671정성태6/15/202131226오류 유형: 724. Tomcat 실행 시 Failed to initialize connector [Connector[HTTP/1.1-8080]] 오류
12670정성태6/13/202121118.NET Framework: 1071. DLL Surrogate를 이용한 Out-of-process COM 개체에서의 CoInitializeSecurity 문제파일 다운로드1
12669정성태6/11/202120495.NET Framework: 1070. 사용자 정의 GetHashCode 메서드 구현은 C# 9.0의 record 또는 리팩터링에 맡기세요.
12668정성태6/11/202123526.NET Framework: 1069. C# - DLL Surrogate를 이용한 Out-of-process COM 개체 제작파일 다운로드2
... 46  47  48  49  50  51  52  [53]  54  55  56  57  58  59  60  ...