πŸ”ŒDocker

[MS μžμŠ΅μ„œ] Docker Application build Python μ—λŸ¬ ν•΄κ²°

harry.93 2022. 1. 10. 22:52
λ°˜μ‘ν˜•

https://docs.microsoft.com/ko-kr/visualstudio/docker/tutorials/your-application

 

Docker μžμŠ΅μ„œ - 2λΆ€: todo λͺ©λ‘ μƒ˜ν”Œ μ•± λΉŒλ“œ 및 μ‹€ν–‰

Node.jsμ—μ„œ μ‹€ν–‰λ˜λŠ” todo λͺ©λ‘ μƒ˜ν”Œ 앱에 λŒ€ν•œ κ°œμš”μž…λ‹ˆλ‹€.

docs.microsoft.com

 

Docker μžμŠ΅μ„œλ₯Ό 톡해 κ³΅λΆ€ν•˜λ˜ 도쀑 2μž₯ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ λ§Œλ“€κΈ°μ—μ„œ μ—λŸ¬κ°€ λ°œμƒν•˜μ˜€λ‹€.

docker λΉŒλ“œ 도쀑 μ—λŸ¬κ°€ λ°œμƒν•˜μ˜€μœΌλ©°, μ—λŸ¬ λ‚΄μš©μ€ λ‹€μŒκ³Ό κ°™μ•˜λ‹€.

Can't find Python executable "python", you can set the PYTHON env variable.

파이썬 λ‚΄λΆ€ 경둜 ν˜Ήμ€ μ§€μ •λœ λ³€μˆ˜λ₯Ό μ°Ύμ§€ λͺ»ν•˜λŠ” μ—λŸ¬ 같은데. 기쑴에 λ§₯뢁에 κΉ”λ €μžˆλ˜ 것은 기본으둜 μ„€μΉ˜λ˜μ–΄μžˆλ˜ 2.7 버전 μ΄μ—ˆλ‹€. ν•˜μ§€λ§Œ 쑰금 κ²€μƒ‰ν•˜λ‹€λ³΄λ‹ˆ λ§₯μ—μ„œ ν˜„μž¬ 2.7 버전을 ꢌμž₯ν•˜μ§€ μ•ŠμœΌλ©° 버전을 μ—…κ·Έλ ˆμ΄λ“œ ν•˜λΌλŠ” λ‚΄μš©μ΄ μžˆμ–΄ 3.10으둜 μ—…κ·Έλ ˆμ΄λ“œ ν›„, κΈ°λ³Έ 파이썬 μ•Œλ¦¬μ•„μŠ€λ₯Ό 3.10 λŒ€λ‘œ μž‘μ•„λ†“μ€ μƒν™©μ΄μ—ˆλ‹€. 

이 μƒν™©μ—μ„œ Docker λΉŒλ“œ μ‹œ, μ—λŸ¬κ°€ λ°œμƒν•˜μ—¬ ꡬ글링을 ν•˜μ—¬ λ‹€μŒκ³Ό 같은 λ‚΄μš©μ˜ 글을 μ°Ύμ•˜λ‹€.

https://github.com/docker/getting-started/issues/124

 

docker build command fails on yarn install step with error "gyp ERR! find Python" · Issue #124 · docker/getting-started

I'm trying to follow the getting-started tutorial on a Raspberry Pi 4 with Debian 10 installed, but I'm running into some issues. I think they might be related to using the arm architecture...

github.com

 

μ•„λ§ˆ M1 ν”„λ‘œμ„Έμ„œλ‘œ μ˜¬λΌμ˜€λ©΄μ„œ 무언가 변경점이 생긴 λ“― ν–ˆλ‹€. 그리고, μžμŠ΅μ„œμ—μ„œ μ œκ³΅ν•˜λŠ” κΈ°λ³Έ μ½”λ“œμ˜ κ²½μš°μ— 파이썬이 ν¬ν•¨λ˜μ§€ μ•Šμ•„? λ°œμƒν•˜λŠ” 문제 같아보인닀. apk add ꡬ문이 μΆ”κ°€λœ κ²ƒμœΌλ‘œ λ³Ό λ•Œ, 그럴 κ°€λŠ₯성이 μžˆλ‹€κ³  μƒκ°ν–ˆλ‹€. 

ν•˜μ—¬ 기쑴에 μ„€μΉ˜ν•œ 파이썬 3.10버전을 μ œκ±°ν•˜κ³  λ‹€μ‹œ 2.7버전 λŒ€λ‘œ 내렀와 λΉŒλ“œ ν•˜λ‹ˆ 정상 λ™μž‘ ν–ˆλ‹€. ꡬ문 μƒμ—μ„œ 3.10버전 λŒ€λ‘œ μ§„ν–‰ν•˜λ©΄ μ΄μƒν•˜κ²Œ 또 μ•ˆλœλ‹€... 

 

2022.01.10 λΉŒλ“œ 성곡 μ½”λ“œ

- Dockerfile

FROM node:12-alpine
RUN apk add --no-cache python2 g++ make
WORKDIR /app
COPY . .
RUN apk --no-cache --virtual build-dependencies add \
  python2 \
  make \
  g++
RUN yarn install --production
CMD ["node", "src/index.js"]

 

728x90
λ°˜μ‘ν˜•