#9 11.82 npm ERR! code ENOENT
#9 11.83 npm ERR! path git
#9 11.83 npm ERR! errno -2
#9 11.83 npm ERR! enoent Error while executing:
#9 11.83 npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
#9 11.83 npm ERR! enoent
#9 11.83 npm ERR! enoent
#9 11.83 npm ERR! enoent This is related to npm not being able to find a file.
#9 11.85
#9 11.85 npm ERR! A complete log of this run can be found in:
#9 11.85 npm ERR!     /root/.npm/_logs/2020-11-10T14_49_13_350Z-debug.log

이거로 한참을 헤매었다.... 아오~

 

FROM node:14.15-alpine
WORKDIR /app
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

dockerfile이다... 별 문제 없어 보인다. 그러니 저런 에러가 나오면 멘붕이지...

alpine 이미지의 특성인지는 모르겠지만 "git@github.com/eligrey/FileSaver.js.git" 이 repository를 땡겨오는데 문제가 생겼고 path git 이라는 문구도 보인다... 설마설마... alpine에 git이 없나??? (npm install인데 git에서도 땡겨오는지는 몰랐음....)

 

RUN git --verion을 추가하기에 이르렀다. 예상대로 git 명령어 없음.

 

RUN npm install 전에 아래 추가하여 git 설치 했더니 문제 없이 docker image가 build되었다.

 

RUN apk update && apk upgrade && apk add --no-cache bash git openssh

docker remote API는 local PC에 docker가 설치 되어 있지 않더라고 외부 서버의 docker를 사용하는 방법입니다.

TCP 소켓을 이용한 remote API

 

hmpark2@SVC-Build:/lib/systemd/system$ sudo vi docker.service 

[sudo] hmpark2의 암호: 

hmpark2@SVC-Build:/lib/systemd/system$ sudo service docker restart

Warning: The unit file, source configuration file or drop-ins of docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.

hmpark2@SVC-Build:/lib/systemd/system$ systemctl daemon-reload

hmpark2@SVC-Build:/lib/systemd/system$ 

 

위 첨부 그림중 빨간색 칸의 내용을 추가 하였고 2376port가 동작하는 것을 아래와 같이 확인 하였습니다.

docker remote API 호출

이제는 gradle을 이용해서 remote API로 원격빌드를 해보자. 다음 gradle plugin을 사용할 예정이다.

https://github.com/bmuschko/gradle-docker-plugin

 

bmuschko/gradle-docker-plugin

Gradle plugin for managing Docker images and containers. - bmuschko/gradle-docker-plugin

github.com

-이미지 출처 : https://m.blog.naver.com/alice_k106/220234130166

 

8. [Docker] Docker Remote API - 1. 시작하기

본 포스팅은 Java를 이용한 Docker Remote API를 사용할 수 있도록 도와주는 가이드라인이며, 본인이...

blog.naver.com

+ Recent posts