æ¦è¦
以åãä½ã¬ã¤ã¤ãç¥ããã人ã®ããã®Cã³ã³ãã¤ã©ä½æå ¥éããã£ã¦ããããM1èµ·å ã«ããã¨ã©ã¼ãåºãã®ã§ä»¥ä¸ã®è¨äºã§è§£æ±ºããã®ã ããä¹ ãã¶ãã«Dev Containerã§éãã¦ã¿ããéãã¨ã©ã¼ãèµ·ããã®ã§ãããã¡ãããããªãã£ã¦ãã話ã追è¨: ä¸å¿è§£æ±ºã§ããã追è¨ã«è§£æ±ºçãæ¸ã
åé¡
ããããDockerã³ã³ãããç«ã¡ä¸ãããã¨ããã以ä¸ã®ã¨ã©ã¼ãèµ·ããã
Error fetching image details: No manifest found for docker.io/amd64/ubuntu:latest. Start: Run: docker pull amd64/ubuntu:latest latest: Pulling from amd64/ubuntu no matching manifest for linux/arm64/v8 in the manifest list entries Stop (2458 ms): Run: docker pull amd64/ubuntu:latest [] Error response from daemon: No such image: amd64/ubuntu:latest
ãã£ãã¼ï¼åã¯ããã¦ãã®ã«ãªã¨æã£ã¦ããã¨no matching manifest for linux/arm64/v8 in the manifest list entries
ã¨ããã
解決ã§ããªã
解決çããã®ããªãæãã¤ããªããåã¯æãéçã«AMDã®Ubuntuã¤ã¡ã¼ã¸ã使ã£ã¦Intelã®CPUã¢ã¼ããã¯ãã£ã使ç¨ãã¦ããã ã§ãARMç¨ã®ã¢ã¼ããã¯ãã£ã®ã¤ã¡ã¼ã¸ãã使ããªãã¨ãªãã¨ãDockerã§ã¯Intelç³»ã®CPUã¢ã¼ããã¯ãã£ã¯ä½¿ããªãã®ããªã
試ãã« FROM arm64v8/ubuntu:latest
ã«æ¸ãæãããIntelã®syntaxã使ããªããªã£ããã©ããããããããã
tmp.s: Assembler messages: tmp.s:1: Error: unknown pseudo-op: `.intel_syntax' tmp.s:4: Error: expected a register or register list at operand 1 -- `mov rax,123'
追è¨: 解決ç
platformã®ã³ãã³ãã追å ãããããããèªåã¯docker-composeã« platform: linux/amd64
ã追å ããã
Dockerfile
FROM ubuntu:latest RUN apt update RUN DEBIAN_FRONTEND=noninteractive apt install -y gcc make git binutils libc6-dev gdb sudo RUN adduser --disabled-password --gecos '' user RUN echo 'user ALL=(root) NOPASSWD:ALL' > /etc/sudoers.d/user USER user WORKDIR /home/user
docker-compose.yml
version: '3' services: compilerbook: platform: linux/amd64 volumes: - '$HOME/dev/9cc:/9cc' build: context: . dockerfile: Dockerfile