성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] Stating the obvious about debugging...
[정성태] https://www.c-sharpcorner.com/artic...
[정성태] How can I detect if one of my helpe...
[정성태] 32비트 값을 64비트 레지스터에 넣을 때, 상위 32비트에 대...
[정성태] 본문에서 상위 8바이트의 16비트가 사용되지 않는 것을 볼 수 ...
[정성태] 한 번도 궁금한 적이 없었는데, If I mark my t...
[정성태] 그냥 RSS Reader 기능과 약간의 UI 편의성 때문에 사용...
[이종효] 오래된 소프트웨어는 보안 위협이 되기도 합니다. 혹시 어떤 기능...
[정성태] @Keystroke IEEE의 문서를 소개해 주시다니... +_...
[손민수 (Keystroke)] 괜히 듀얼채널 구성할 때 한번에 같은 제품 사라고 하는 것이 아...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>ARM + docker 환경에서 .NET 8 설치</h1> <p> <a target='tab' href='https://www.sysnet.pe.kr/2/0/13727'>ARM 리눅스 환경</a>에서 docker 설치 후, Ubuntu 18.04 컨테이너로 "apt install dotnet-sdk-8.0"을 빌드했더니 이런 오류가 발생합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > $ <span style='color: blue; font-weight: bold'>docker build -t https://raw.githubusercontent.com/stjeong/sample_docker_script/main/dockerfile.ubuntu18.net8 -f test.dockerfile .</span> ...[생략]... => ERROR [7/7] <span style='color: blue; font-weight: bold'>RUN apt install -y dotnet-sdk-8.0 </span> 3.6s ------ > [7/7] RUN apt install -y dotnet-sdk-8.0: 0.442 0.442 WARNING: apt does not have a stable CLI interface. Use with caution in scripts. 0.442 0.582 Reading package lists... 2.979 Building dependency tree... 3.359 Reading state information... 3.551 E: Unable to locate package dotnet-sdk-8.0 3.551 E: Couldn't find any package by glob 'dotnet-sdk-8.0' 3.551 E: Couldn't find any package by regex 'dotnet-sdk-8.0' ------ 1 warning found (use docker --debug to expand): - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 12) test.dockerfile:11 -------------------- 9 | 10 | RUN apt update && apt install -y 11 | >>> RUN apt install -y dotnet-sdk-8.0 12 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 13 | -------------------- ERROR: failed to solve: process "/bin/sh -c apt install -y dotnet-sdk-8.0" did not complete successfully: exit code: 100 </pre> <br /> x64 버전의 Ubuntu 18.04와는 달리 ARM 버전의 repo에는 dotnet-sdk-8.0이 없어서 그런 듯합니다. 이런 경우에는, 직접 .NET 8을 설치하면 됩니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > 설치 스크립트를 사용하거나 이진 파일을 추출하여 Linux에 .NET 설치 ; <a target='tab' href='https://learn.microsoft.com/ko-kr/dotnet/core/install/linux-scripted-manual#scripted-install'>https://learn.microsoft.com/ko-kr/dotnet/core/install/linux-scripted-manual#scripted-install</a> </pre> <br /> 아래는 위의 과정을 종합한 dockerfile입니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > # <a target='tab' href='https://raw.githubusercontent.com/stjeong/sample_docker_script/main/dockerfile.ubuntu18.script.net8'>https://raw.githubusercontent.com/stjeong/sample_docker_script/main/dockerfile.ubuntu18.script.net8</a> FROM ubuntu:18.04 RUN apt-get update && apt-get install -y --no-install-recommends clang zlib1g-dev wget ca-certificates RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb RUN dpkg -i packages-microsoft-prod.deb RUN rm packages-microsoft-prod.deb RUN apt update && apt install -y WORKDIR /app/dotnet RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh RUN chmod +x ./dotnet-install.sh RUN ./dotnet-install.sh --version latest WORKDIR / RUN rm -r /app/dotnet </pre> <br /> dotnet-install.sh의 기본 설치 경로는 "~/.dotnet"입니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > $ <span style='color: blue; font-weight: bold'>docker build -t net8_ubuntu18_build -f https://raw.githubusercontent.com/stjeong/sample_docker_script/main/dockerfile.ubuntu18.script.net8 .</span> $ <span style='color: blue; font-weight: bold'>docker run -it --rm net8_ubuntu18_build /bin/bash</span> root@c7954f57a7d4:/# <span style='color: blue; font-weight: bold'>~/.dotnet/dotnet</span> Usage: dotnet [options] Usage: dotnet [path-to-application] Options: -h|--help Display help. --info Display .NET information. --list-sdks Display the installed SDKs. --list-runtimes Display the installed runtimes. path-to-application: The path to an application .dll file to execute. </pre> <br /> 참고로, 포트 포워딩 시 "<a target='tab' href='https://www.sysnet.pe.kr/2/0/13730'>docker - RULE_APPEND failed (No such file or directory): rule in chain DOCKER</a>" 오류가 발생할 수 있습니다.<br /> <br /> <hr style='width: 50%' /><br /> <br /> github에 놓인 dockerfile을 활용하는 경우, 저처럼 ^^; 무심코 이런 실수를 할 수 있습니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > $ <span style='color: blue; font-weight: bold'>docker build -t net8_ubuntu18_build -f https://github.com/stjeong/sample_docker_script/blob/main/dockerfile.ubuntu18.net8 .</span> [+] Building 1.7s (2/2) FINISHED docker:default => [internal] load https://github.com/stjeong/sample_docker_script/blob/main/dockerfile.ubuntu18.net8 0.6s => [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 323.94kB 0.0s ERROR: failed to receive status: rpc error: code = ResourceExhausted desc = trying to send message larger than max (246084338 vs. 16777216) </pre> <br /> 저 오류로 검색하면 별다른 정보가 안 나올 텐데요, 잘 보시면, github 측 주소를 웹 브라우저에서 repo 방문할 때 쓴 주소를 그대로 사용했습니다. ^^; 따라서 "raw" 주소로 바꿔야 합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > $ docker build -t net8_ubuntu18_build -f https://<span style='color: blue; font-weight: bold'>raw.githubusercontent.com</span>/stjeong/sample_docker_script/main/dockerfile.ubuntu18.net8 . </pre> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
1749
(왼쪽의 숫자를 입력해야 합니다.)