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

비밀번호

댓글 작성자
 




... 76  77  78  79  80  81  [82]  83  84  85  86  87  88  89  90  ...
NoWriterDateCnt.TitleFile(s)
11964정성태6/30/201923412Linux: 20. C# - Linux에서의 Named Pipe를 이용한 통신
11963정성태6/29/201922978Linux: 19. C# - .NET Core Unix Domain Socket 사용 예제
11962정성태6/27/201920631Math: 61. C# - 로지스틱 회귀를 이용한 선형분리 불가능 문제의 분류파일 다운로드1
11961정성태6/27/201921777Graphics: 37. C# - PLplot - 출력 모음(Family File Output)
11960정성태6/27/201922808Graphics: 36. C# - PLplot의 16색 이상을 표현하는 방법과 subpage를 이용한 그리드 맵 표현
11959정성태6/27/201923988Graphics: 35. matplotlib와 PLplot의 한글 처리
11958정성태6/25/201928293Linux: 18. C# - .NET Core Console로 리눅스 daemon 프로그램 만드는 방법 [6]
11957정성태6/24/201924999Windows: 160. WMI 쿼리를 명령행에서 간단하게 수행하는 wmic.exe [2]
11956정성태6/24/201925052Linux: 17. CentOS 7에서 .NET Core Web App 실행 환경 구성 [1]
11955정성태6/20/201923138Math: 60. C# - 로지스틱 회귀를 이용한 분류파일 다운로드1
11954정성태6/20/201920739오류 유형: 550. scp - sudo: no tty present and no askpass program specified
11953정성태6/20/201918421오류 유형: 549. The library 'libhostpolicy.so' required to execute the application was not found in '...'
11952정성태6/20/201919786Linux: 16. 우분투, Centos의 Netbios 호스트 이름 풀이 방법
11951정성태6/20/201923026오류 유형: 548. scp 연결 시 "Permission denied" 오류 및 "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" 경고
11950정성태6/18/201924537.NET Framework: 845. C# - 윈도우 작업 관리자와 리소스 모니터의 메모리 값을 구하는 방법
11949정성태6/18/201919711오류 유형: 547. CoreCLR Profiler 예제 프로젝트 빌드 시 컴파일 오류 유형
11948정성태6/17/201920860Linux: 15. 리눅스 환경의 Visual Studio Code에서 TFS 서버 연동
11947정성태6/17/201923974Linux: 14. 리눅스 환경에서 TFS 서버 연동
11946정성태6/17/201925223개발 환경 구성: 445. C# - MathNet으로 정규 분포를 따르는 데이터를 생성, PLplot으로 Histogram 표현파일 다운로드1
11945정성태6/17/201922300Linux: 13. node.js에서 syslog로 출력하는 방법
11944정성태6/16/201928575Linux: 12. Ubuntu 16.04/18.04에서 node.js 최신 버전 설치 방법
11943정성태6/15/201922075.NET Framework: 844. C# - 박싱과 언박싱 [1]
11942정성태6/13/201927309개발 환경 구성: 444. 로컬의 Visual Studio Code로 원격 리눅스 머신에 접속해 개발하는 방법 [1]
11941정성태6/13/201919721오류 유형: 546. "message NETSDK1057: You are using a preview version of .NET Core" 빌드 경고 없애는 방법
11940정성태6/13/201919906개발 환경 구성: 443. Visual Studio의 Connection Manager 기능(Remote SSH 관리)을 위한 명령행 도구파일 다운로드1
11939정성태6/13/201918416오류 유형: 545. Managed Debugging Assistant 'FatalExecutionEngineError'
... 76  77  78  79  80  81  [82]  83  84  85  86  87  88  89  90  ...